#![forbid(unsafe_code)]
pub use miette::{Diagnostic, Report};
use thiserror::Error;
pub type Result<T, E = Error> = std::result::Result<T, E>;
#[derive(Debug, Error, Diagnostic)]
#[non_exhaustive]
pub enum Error {
#[error("configuration error: {0}")]
#[diagnostic(code(rtb::config))]
Config(String),
#[error("I/O error: {0}")]
#[diagnostic(code(rtb::io))]
Io(#[from] std::io::Error),
#[error("command not found: {0}")]
#[diagnostic(code(rtb::command_not_found), help("run `--help` to list available commands"))]
CommandNotFound(String),
#[error("feature `{0}` is not compiled in")]
#[diagnostic(
code(rtb::feature_disabled),
help("rebuild with the appropriate Cargo feature enabled")
)]
FeatureDisabled(&'static str),
#[error("{0}")]
#[diagnostic(transparent)]
Other(#[from] Box<dyn Diagnostic + Send + Sync + 'static>),
}
pub mod hook;