diff options
Diffstat (limited to 'rola-utils/space-system/src/space/error.rs')
| -rw-r--r-- | rola-utils/space-system/src/space/error.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/rola-utils/space-system/src/space/error.rs b/rola-utils/space-system/src/space/error.rs index 8e85010..f039698 100644 --- a/rola-utils/space-system/src/space/error.rs +++ b/rola-utils/space-system/src/space/error.rs @@ -1,3 +1,5 @@ +use serde::Serialize; + #[derive(thiserror::Error, Debug)] pub enum SpaceError { #[error("Space not found")] @@ -19,6 +21,15 @@ pub enum SpaceError { ConfigFileAlreadyExist, } +impl Serialize for SpaceError { + fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> + where + S: serde::Serializer, + { + serializer.serialize_str(&self.to_string()) + } +} + impl PartialEq for SpaceError { fn eq(&self, other: &Self) -> bool { match (self, other) { |
