32 lines
1.0 KiB
Rust
32 lines
1.0 KiB
Rust
// Workspace: weaponry
|
|
// File: weaponry/src/error.rs
|
|
//! Inner weaponry error definition
|
|
#![allow(missing_docs, clippy::missing_docs_in_private_items)]
|
|
|
|
use thiserror::Error;
|
|
|
|
#[derive(Error, Debug)]
|
|
/// Unrecoverable Error, all these error cannot gracefully fail and must return to the User for further handling
|
|
pub enum FatalEquipementError {
|
|
#[error("Unkown error has errored")]
|
|
Unknown,
|
|
}
|
|
|
|
#[derive(Error, Debug)]
|
|
/// Recoverable error, all these error exist to signal a retry or another path that should be taken by the program
|
|
pub enum TrivialEquipementError {
|
|
#[error("Very simple error")]
|
|
Oops,
|
|
}
|
|
|
|
#[derive(Error, Debug)]
|
|
/// An equipement error, either unrecoverable, indicating a that the execution
|
|
/// flow must be stopped and only an user input can solve the issue
|
|
pub enum EquipementError {
|
|
#[error("An unrecoverable error occured: {0}")]
|
|
Unrecoverable(#[from] FatalEquipementError),
|
|
|
|
#[error("A recoverable error occured but wasn't caught by the programming: {0}")]
|
|
Recoverable(#[from] TrivialEquipementError),
|
|
}
|