mirror of
https://github.com/aljazceru/notedeck.git
synced 2026-01-07 02:14:19 +01:00
home: move subscriptions to timeline
This commit is contained in:
24
src/error.rs
24
src/error.rs
@@ -1,26 +1,34 @@
|
||||
use shatter::parser;
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
NoActiveSubscription,
|
||||
Nostr(enostr::Error),
|
||||
Ndb(nostrdb::Error),
|
||||
Shatter(parser::Error),
|
||||
Image(image::error::ImageError),
|
||||
Generic(String),
|
||||
}
|
||||
|
||||
impl fmt::Display for Error {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::NoActiveSubscription => {
|
||||
write!(f, "subscription not active in timeline")
|
||||
}
|
||||
Self::Nostr(e) => write!(f, "{e}"),
|
||||
Self::Ndb(e) => write!(f, "{e}"),
|
||||
Self::Image(e) => write!(f, "{e}"),
|
||||
Self::Generic(e) => write!(f, "{e}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<String> for Error {
|
||||
fn from(s: String) -> Self {
|
||||
Error::Generic(s)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<parser::Error> for Error {
|
||||
fn from(s: parser::Error) -> Self {
|
||||
Error::Shatter(s)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<nostrdb::Error> for Error {
|
||||
fn from(e: nostrdb::Error) -> Self {
|
||||
Error::Ndb(e)
|
||||
|
||||
Reference in New Issue
Block a user