diff options
| author | n1c00o <34602094+n1c00o@users.noreply.github.com> | 2021-10-16 22:26:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-16 22:26:09 +0200 |
| commit | e58e816ceb8caa3c77dd98a952761b7e7f05b6cb (patch) | |
| tree | ca5c9409986ff538e7a674473c1d642627d1055c /common/rust/src/error.rs | |
| parent | 03908129599260587fe7b9fd8254d28ad50b8714 (diff) | |
| parent | b94b0552f81e667bec31352901bbc8c76f1b4216 (diff) | |
Merge branch 'main' into nats-structs-discord-gateway
Diffstat (limited to 'common/rust/src/error.rs')
| -rw-r--r-- | common/rust/src/error.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/common/rust/src/error.rs b/common/rust/src/error.rs index b602940..1a24657 100644 --- a/common/rust/src/error.rs +++ b/common/rust/src/error.rs @@ -7,6 +7,12 @@ pub struct NovaError { 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 + write!(f, "An error occurred within the nova system: {}", self.message) // user-facing output } } + +impl From<&str> for NovaError { + fn from(message: &str) -> Self { + NovaError { message: message.to_string() } + } +}
\ No newline at end of file |
