opaquerr::define_kind! {
pub ErrorKind {
Protocol => "nostr protocol error",
Sdk => "SDK error",
NoResponse => "response not received",
Other => "other error",
}
}
opaquerr::define_error! {
pub Error(ErrorKind)
from {
nostr::error::Error => ErrorKind::Protocol,
nostr_sdk::error::Error => ErrorKind::Sdk,
}
}
impl Error {
#[inline]
pub(super) fn no_response() -> Self {
Self::simple(ErrorKind::NoResponse)
}
}