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

29 lines
680 B
Rust
Raw Normal View History

use bincode::ErrorKind;
use wasmer_runtime::error::{ResolveError, RuntimeError};
#[derive(Debug)]
pub enum PluginError {
Io(std::io::Error),
Toml(toml::de::Error),
NoConfig,
NoSuchModule,
PluginModuleError(PluginModuleError),
}
#[derive(Debug)]
pub enum PluginModuleError {
FindFunction(String),
FunctionGet(ResolveError),
Compile(wasmer_runtime::error::CompileError),
Instantiate(wasmer_runtime::error::Error),
2020-12-14 16:07:05 +00:00
MemoryAllocation(MemoryAllocationError),
RunFunction(RuntimeError),
Encoding(Box<ErrorKind>),
}
2020-12-14 16:07:05 +00:00
#[derive(Debug)]
pub enum MemoryAllocationError {
AllocatorNotFound(ResolveError),
CantAllocate(RuntimeError),
}