diff options
| author | Matthieu <matthieu@developershouse.xyz> | 2021-09-18 00:17:22 +0400 |
|---|---|---|
| committer | Matthieu <matthieu@developershouse.xyz> | 2021-09-18 00:17:22 +0400 |
| commit | 88300c45202a228d54c1e99dd3b295ef3fb9aabd (patch) | |
| tree | 63a2679ad815cde8c6bd2325fda7123b08ad284f /common/rust/src/error.rs | |
| parent | 469a8fb1ea7b689399c30badbf33fc467531c561 (diff) | |
work on the gateway
Diffstat (limited to 'common/rust/src/error.rs')
| -rw-r--r-- | common/rust/src/error.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/common/rust/src/error.rs b/common/rust/src/error.rs new file mode 100644 index 0000000..dcb7a54 --- /dev/null +++ b/common/rust/src/error.rs @@ -0,0 +1,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 + } +} + |
