randomx_rust_wrapper/
errors.rs1use thiserror::Error as ThisError;
18
19use crate::flags::RandomXFlags;
20
21#[derive(ThisError, Debug, Clone)]
22pub enum RandomXError {
23 #[error("cache allocation with flags {flags:?} failed")]
24 CacheAllocationFailed { flags: RandomXFlags },
25
26 #[error("dataset allocation with flags {flags:?} failed")]
27 DatasetAllocationError { flags: RandomXFlags },
28
29 #[error(transparent)]
30 VMCreationFailed(#[from] VmCreationError),
31}
32
33#[derive(ThisError, Debug, Clone)]
34pub enum VmCreationError {
35 #[error("vm allocation with flags {flags:?} failed")]
36 AllocationFailed { flags: RandomXFlags },
37
38 #[error("to allocate vm in the fast mode, flags {flags:?} must contain the full mem option")]
39 IncorrectFastModeFlag { flags: RandomXFlags },
40
41 #[error(
42 "to allocate vm in the light mode, flags {flags:?} must no contain the full mem option"
43 )]
44 IncorrectLightModeFlag { flags: RandomXFlags },
45}