use miette::Diagnostic;
use thiserror::Error;
#[derive(Error, Debug, Diagnostic)]
pub enum OkuFsError {
#[error("File system entry not found.")]
#[diagnostic(
code(fs::fs_entry_not_found),
url(docsrs),
help("Please ensure that the file system entry exists before attempting to read it.")
)]
FsEntryNotFound,
}
#[derive(Error, Debug, Diagnostic)]
pub enum OkuDiscoveryError {
#[error("Invalid hash and format.")]
#[diagnostic(code(discovery::invalid_hash_and_format), url(docsrs))]
InvalidHashAndFormat,
#[error("Problem announcing {0} ({1}).")]
#[diagnostic(code(discovery::problem_announcing_content), url(docsrs))]
ProblemAnnouncingContent(String, String),
}
#[derive(Error, Debug, Diagnostic)]
pub enum OkuRelayError {
#[error("No connected node can satisfy {0}.")]
#[diagnostic(code(relay::cannot_satisfy_request), url(docsrs))]
CannotSatisfyRequest(String),
}