aboutsummaryrefslogtreecommitdiffstats
path: root/src/error.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@blos.sm>2023-06-21 19:32:30 +0100
committerLibravatar cel 🌸 <cel@blos.sm>2023-06-21 19:32:30 +0100
commit14db008af73d25cc92ea6c0b1f3b1e0ef67920d1 (patch)
treebe9eecf46dd7dc01686e26b88e27f98d8e9c7fdd /src/error.rs
parente0cd7838c350cb9814d8285cad04648f32b3db59 (diff)
downloadblossom-14db008af73d25cc92ea6c0b1f3b1e0ef67920d1.tar.gz
blossom-14db008af73d25cc92ea6c0b1f3b1e0ef67920d1.tar.bz2
blossom-14db008af73d25cc92ea6c0b1f3b1e0ef67920d1.zip
implement foundation for posts
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index 890a148..81cadd1 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -5,6 +5,10 @@ pub enum BlossomError {
Reqwest(Status, #[response(ignore)] reqwest::Error),
ListenBrainz(Status, #[response(ignore)] listenbrainz::Error),
Skinnyverse(Status, #[response(ignore)] mastodon_async::Error),
+ Chrono(Status, #[response(ignore)] chrono::ParseError),
+ Io(Status, #[response(ignore)] std::io::Error),
+ Deserialization(Status, #[response(ignore)] toml::de::Error),
+ NoMetadata(Status),
Unimplemented(Status),
}
@@ -25,3 +29,21 @@ impl From<mastodon_async::Error> for BlossomError {
BlossomError::Skinnyverse(Status::new(500), e)
}
}
+
+impl From<chrono::ParseError> for BlossomError {
+ fn from(e: chrono::ParseError) -> Self {
+ BlossomError::Chrono(Status::new(500), e)
+ }
+}
+
+impl From<std::io::Error> for BlossomError {
+ fn from(e: std::io::Error) -> Self {
+ BlossomError::Io(Status::new(500), e)
+ }
+}
+
+impl From<toml::de::Error> for BlossomError {
+ fn from(e: toml::de::Error) -> Self {
+ BlossomError::Deserialization(Status::new(500), e)
+ }
+}