mirror of
https://github.com/aljazceru/notedeck.git
synced 2026-01-03 16:34:20 +01:00
profile picture image cache
coding from a plane so this is helping alot with PFPs
This commit is contained in:
14
src/error.rs
14
src/error.rs
@@ -1,8 +1,10 @@
|
||||
use std::fmt;
|
||||
use std::{fmt, io};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
NoActiveSubscription,
|
||||
LoadFailed,
|
||||
Io(io::Error),
|
||||
Nostr(enostr::Error),
|
||||
Ndb(nostrdb::Error),
|
||||
Image(image::error::ImageError),
|
||||
@@ -15,10 +17,14 @@ impl fmt::Display for Error {
|
||||
Self::NoActiveSubscription => {
|
||||
write!(f, "subscription not active in timeline")
|
||||
}
|
||||
Self::LoadFailed => {
|
||||
write!(f, "load failed")
|
||||
}
|
||||
Self::Nostr(e) => write!(f, "{e}"),
|
||||
Self::Ndb(e) => write!(f, "{e}"),
|
||||
Self::Image(e) => write!(f, "{e}"),
|
||||
Self::Generic(e) => write!(f, "{e}"),
|
||||
Self::Io(e) => write!(f, "{e}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,3 +52,9 @@ impl From<enostr::Error> for Error {
|
||||
Error::Nostr(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<io::Error> for Error {
|
||||
fn from(err: io::Error) -> Self {
|
||||
Error::Io(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user