~deciduously/fcalc

ref: 5ba32ecfb93e39f3b11e2abaa2ba6d5c7c848544 fcalc/src/error.rs -rw-r--r-- 419 bytes
5ba32ecfBen Lovy Recipe lookup a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Top-level error struct

use std::io;
use thiserror::Error;

#[derive(Debug, Error)]
pub enum FcalcError {
    #[error("Could not read input data file")]
    FileError(#[from] io::Error),
    #[error("Bad product type")]
    ProductTypeError,
    #[error("Bad building type")]
    InvalidBuildingType
}

/// Export convenient Result type carrying this error.
pub type Result<T> = std::result::Result<T, FcalcError>;