use std::io;
use thiserror::Error;
pub type CustomUserError = Box<dyn std::error::Error + Send + Sync + 'static>;
#[derive(Error, Debug)]
pub enum InquireError {
#[error("The input device is not a TTY")]
NotTTY,
#[error("The prompt configuration is invalid: {0}")]
InvalidConfiguration(String),
#[error("IO error: {0}")]
IO(#[from] io::Error),
#[error("Operation was canceled by the user")]
OperationCanceled,
#[error("Operation was interrupted by the user")]
OperationInterrupted,
#[error("User-provided error: {0}")]
Custom(#[from] CustomUserError),
}
pub type InquireResult<T> = Result<T, InquireError>;