veloren/common/sys/src/plugin/errors.rs
2021-02-22 23:59:15 +01:00

32 lines
768 B
Rust

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),
MemoryAllocation(MemoryAllocationError),
MemoryUninit(ExportError),
FindFunction(ExportError),
RunFunction(RuntimeError),
InvalidArgumentType(),
Encoding(Box<ErrorKind>),
}
#[derive(Debug)]
pub enum MemoryAllocationError {
InvalidReturnType,
AllocatorNotFound(ExportError),
CantAllocate(RuntimeError),
}