#[derive(Debug, thiserror::Error)]
pub enum SurveyError {
#[error("Survey cancelled by user")]
Cancelled,
#[error("Backend error: {0}")]
Backend(#[from] anyhow::Error),
}
impl SurveyError {
pub fn backend(err: impl Into<anyhow::Error>) -> Self {
Self::Backend(err.into())
}
pub fn is_cancelled(&self) -> bool {
matches!(self, Self::Cancelled)
}
}