use crate::{cli::common::CurrentUnixSecsError, storage::CacheRootError};
use ic_query::sns::SnsHostError;
use std::io;
use thiserror::Error as ThisError;
#[derive(Debug, ThisError)]
pub enum SnsCommandError {
#[error("{0}")]
Usage(String),
#[error(transparent)]
Host(#[from] SnsHostError),
#[error(transparent)]
Clock(#[from] CurrentUnixSecsError),
#[error(transparent)]
Io(#[from] io::Error),
#[error(transparent)]
Json(#[from] serde_json::Error),
}
impl From<CacheRootError> for SnsCommandError {
fn from(error: CacheRootError) -> Self {
Self::Usage(error.to_string())
}
}