summaryrefslogtreecommitdiff
path: root/common/rust/src/error.rs
blob: dcb7a54ebd0b8ef053a047da4fd5e82b8e279331 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::fmt;

pub struct NovaError {
    pub message: String,
}

impl fmt::Display for NovaError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "An error occured wihind the nova system: {}", self.message) // user-facing output
    }
}

impl fmt::Debug for NovaError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{{ file: {}, line: {} }}", file!(), line!()) // programmer-facing output
    }
}