summaryrefslogtreecommitdiff
path: root/common/rust/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'common/rust/src/error.rs')
-rw-r--r--common/rust/src/error.rs8
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