chksum_build/
error.rs

1use std::{env, fmt, io, result};
2
3use {chrono, nom, thiserror};
4
5/// A common error type for the current crate.
6#[derive(Debug, thiserror::Error)]
7pub enum Error {
8    #[cfg_attr(docsrs, doc(hidden))]
9    #[error(transparent)]
10    ChronoParse(#[from] chrono::ParseError),
11    #[cfg_attr(docsrs, doc(hidden))]
12    #[error(transparent)]
13    EnvVar(#[from] env::VarError),
14    #[cfg_attr(docsrs, doc(hidden))]
15    #[error(transparent)]
16    Fmt(#[from] fmt::Error),
17    #[cfg_attr(docsrs, doc(hidden))]
18    #[error(transparent)]
19    Io(#[from] io::Error),
20    #[cfg_attr(docsrs, doc(hidden))]
21    #[error(transparent)]
22    Nom(#[from] nom::error::VerboseError<String>),
23}
24
25/// Type alias for [`Result`](std::result::Result) with an error type of [`Error`].
26pub type Result<T> = result::Result<T, Error>;