pub enum DiceError {
Show 14 variants
TrayNotFound(String),
TrayAlreadyExists(String),
DieNotFound(String),
DieAlreadyExists(String),
SlotNotFound {
tray: String,
slot_id: u32,
},
CannotModifyBuiltin(String),
CannotDeleteInUse {
die: String,
trays: Vec<String>,
},
StorageError(String),
InvalidExpression(String),
InvalidArguments(String),
InsufficientMatchingDice {
tray: String,
die: String,
requested: usize,
available: usize,
},
InvalidFaceCount,
InvalidNumericDie(String),
InvalidName,
}Expand description
Errors that can occur while managing dice, trays, expressions, or storage.
Variants§
TrayNotFound(String)
The requested tray does not exist.
TrayAlreadyExists(String)
A tray with the requested name already exists.
DieNotFound(String)
The requested die does not exist.
DieAlreadyExists(String)
A die with the requested canonical name already exists.
SlotNotFound
The requested tray slot does not exist.
CannotModifyBuiltin(String)
Built-in dice cannot be modified or deleted.
CannotDeleteInUse
The die cannot be deleted because one or more trays reference it.
Fields
StorageError(String)
Storage serialization or persistence failed.
InvalidExpression(String)
A dice expression is malformed or unsupported.
InvalidArguments(String)
A command or parser received invalid arguments.
InsufficientMatchingDice
A tray did not contain enough matching dice to satisfy a request.
Fields
InvalidFaceCount
A custom die or counted expression had no faces.
InvalidNumericDie(String)
Numeric dice must have at least two faces.
InvalidName
A name was empty or contained whitespace.
Trait Implementations§
Source§impl Error for DiceError
impl Error for DiceError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()