nostr-rs-relay/src/error.rs

19 lines
422 B
Rust
Raw Normal View History

//! Error handling.
use std::result;
use thiserror::Error;
pub type Result<T, E = Error> = result::Result<T, E>;
#[derive(Error, Debug)]
2021-11-23 11:29:53 -05:00
pub enum Error {
#[error("command from client not recognized")]
CommandNotFound,
2021-11-23 11:46:47 -05:00
#[error("parsing JSON->Event failed")]
EventParseFailed,
#[error("parsing JSON->Req failed")]
ReqParseFailed,
#[error("parsing JSON->Close failed")]
CloseParseFailed,
2021-11-23 11:29:53 -05:00
}