aboutsummaryrefslogtreecommitdiffstats
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/error.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index eb6f6e6..42c01b1 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -1,3 +1,5 @@
+use std::string::FromUtf8Error;
+
use rocket::{http::Status, Responder};
#[derive(Responder, Debug)]
@@ -8,6 +10,8 @@ pub enum BlossomError {
Chrono(Status, #[response(ignore)] chrono::ParseError),
Io(Status, #[response(ignore)] std::io::Error),
Deserialization(Status, #[response(ignore)] toml::de::Error),
+ Syndicator(Status, #[response(ignore)] atom_syndication::Error),
+ Utf8Conversion(Status, #[response(ignore)] FromUtf8Error),
NotFound(Status),
NoMetadata(Status),
Unimplemented(Status),
@@ -48,3 +52,15 @@ impl From<toml::de::Error> for BlossomError {
BlossomError::Deserialization(Status::new(500), e)
}
}
+
+impl From<atom_syndication::Error> for BlossomError {
+ fn from(e: atom_syndication::Error) -> Self {
+ BlossomError::Syndicator(Status::new(500), e)
+ }
+}
+
+impl From<FromUtf8Error> for BlossomError {
+ fn from(e: FromUtf8Error) -> Self {
+ BlossomError::Utf8Conversion(Status::new(500), e)
+ }
+}