Skip to main content

radicle_surf/
error.rs

1//! Definition for a crate level error type, which wraps up module level
2//! error types transparently.
3
4use crate::{commit, diff, fs, glob, namespace, refs, repo};
5use thiserror::Error;
6
7/// The crate level error type that wraps up module level error types.
8#[derive(Debug, Error)]
9#[non_exhaustive]
10pub enum Error {
11    #[error(transparent)]
12    Branches(#[from] refs::error::Branch),
13    #[error(transparent)]
14    Categories(#[from] refs::error::Category),
15    #[error(transparent)]
16    Commit(#[from] commit::Error),
17    #[error(transparent)]
18    Diff(#[from] diff::git::error::Diff),
19    #[error(transparent)]
20    Directory(#[from] fs::error::Directory),
21    #[error(transparent)]
22    File(#[from] fs::error::File),
23    #[error(transparent)]
24    Git(#[from] git2::Error),
25    #[error(transparent)]
26    Glob(#[from] glob::Error),
27    #[error(transparent)]
28    Namespace(#[from] namespace::Error),
29    #[error(transparent)]
30    RefFormat(#[from] git_ext::ref_format::Error),
31    #[error(transparent)]
32    Revision(Box<dyn std::error::Error + Send + Sync + 'static>),
33    #[error(transparent)]
34    ToCommit(Box<dyn std::error::Error + Send + Sync + 'static>),
35    #[error(transparent)]
36    Tags(#[from] refs::error::Tag),
37    #[error(transparent)]
38    Repo(#[from] repo::error::Repo),
39}