bolt/core/
errors.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use std::fmt;
use std::io;

pub enum BoltErrors {
    IoError(io::Error),
    MissingFiles(String),
    InvalidAction(String),
}

impl fmt::Display for BoltErrors {
    fn fmt(&self, fmtr: &mut fmt::Formatter) -> Result<(), fmt::Error> {
        use BoltErrors::*;

        match self {
            IoError(ref e) => e.fmt(fmtr),
            MissingFiles(ref e) => fmtr.write_str(e),
            InvalidAction(ref e) => fmtr.write_str(e),
        }
    }
}