use thiserror::Error;
#[derive(Error, Debug)]
pub enum SmolmixError {
#[error("Channel closed")]
ChannelClosed,
#[error("Not connected to IPR")]
NotConnected,
#[error("Nym SDK error: {0}")]
NymSdk(#[from] nym_sdk::Error),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
}
impl From<nym_smol_core::SmolCoreError> for SmolmixError {
fn from(err: nym_smol_core::SmolCoreError) -> Self {
match err {
nym_smol_core::SmolCoreError::Io(e) => SmolmixError::Io(e),
nym_smol_core::SmolCoreError::ChannelClosed => SmolmixError::ChannelClosed,
other => SmolmixError::Io(std::io::Error::other(other.to_string())),
}
}
}