Lines
0 %
Functions
Branches
100 %
use std::sync::PoisonError;
use finance::error::FinanceError;
use thiserror::Error;
use wasmtime::Error as WASMError;
#[derive(Debug, Error)]
pub enum HookError {
#[error("WASM: {0}")]
WASM(#[from] WASMError),
#[error("WASM memory access error")]
WASMMem,
#[error("Mutex lock error")]
Lock,
#[error("Finance error: {0}")]
Finance(#[from] FinanceError),
#[error("Parse error: {0}")]
Parse(String),
#[error("Script error: {0}")]
Script(String),
}
impl<T> From<PoisonError<T>> for HookError {
fn from(err: PoisonError<T>) -> Self {
log::error!("Mutex lock error: {err}");
Self::Lock