use thiserror::Error;
use tracing_subscriber::util::TryInitError;
#[derive(Debug, Error)]
pub(crate) enum AuditCheckError {
#[error("An error has occurred")]
Anyhow(#[from] anyhow::Error),
#[error("Unable to pipe stderr")]
Stderr,
#[error("Unable to pipe stdout")]
Stdout,
#[error("Unable to determine status code")]
Code,
#[error("Error joining thread handle")]
Join,
#[error("cargo audit version check failed")]
AuditVersionCheck,
#[error("cargo audit requires rust {msrv:?} or greater")]
RustcVersionCheck { msrv: &'static str },
#[error("failed to initialize tracing")]
TryInit(#[from] TryInitError),
#[error("Unable to create an issue")]
CreateIssue,
#[error("RUSTSEC issue found")]
RustSec,
}