veloren/common/sys/src/plugin/errors.rs

31 lines
745 B
Rust
Raw Normal View History

use bincode::ErrorKind;
use wasmer::{ExportError, InstantiationError, RuntimeError};
#[allow(clippy::large_enum_variant)]
#[derive(Debug)]
pub enum PluginError {
Io(std::io::Error),
Toml(toml::de::Error),
NoConfig,
NoSuchModule,
Encoding(Box<ErrorKind>),
PluginModuleError(String, String, PluginModuleError),
}
#[derive(Debug)]
pub enum PluginModuleError {
InstantiationError(InstantiationError),
2020-12-14 16:07:05 +00:00
MemoryAllocation(MemoryAllocationError),
MemoryUninit(ExportError),
FindFunction(ExportError),
RunFunction(RuntimeError),
InvalidArgumentType(),
Encoding(Box<ErrorKind>),
}
2020-12-14 16:07:05 +00:00
#[derive(Debug)]
pub enum MemoryAllocationError {
AllocatorNotFound(ExportError),
2020-12-14 16:07:05 +00:00
CantAllocate(RuntimeError),
}