#[derive(Debug, Clone)]
pub struct TermError;

// TODO: https://learning-rust.github.io/docs/e7.custom_error_types.html
//       for custom text on error code
impl std::fmt::Display for TermError {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        write!(f, "error while creating new terminal")
    }
}

impl std::error::Error for TermError {
    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
        // Generic error, underlying cause isn't tracked.
        None
    }
}