diff --git a/workspaces/src/error/impls.rs b/workspaces/src/error/impls.rs index 0aa75643..2c685362 100644 --- a/workspaces/src/error/impls.rs +++ b/workspaces/src/error/impls.rs @@ -35,7 +35,10 @@ impl Error { } } - pub(crate) fn full(kind: ErrorKind, msg: T, error: E) -> Self + /// Construct a workspaces [`Error`] with the full details of an error which includes + /// the internal error it references, the custom error message with further context + /// and the [`ErrorKind`] that represents the category of error. + pub fn full(kind: ErrorKind, msg: T, error: E) -> Self where T: Into>, E: Into>, @@ -49,7 +52,10 @@ impl Error { } } - pub(crate) fn custom(kind: ErrorKind, error: E) -> Self + /// Construct a workspaces [`Error`] with the details of an error which includes + /// the internal error it references and the [`ErrorKind`] that represents the + /// category of error. + pub fn custom(kind: ErrorKind, error: E) -> Self where E: Into>, { @@ -61,7 +67,10 @@ impl Error { } } - pub(crate) fn message(kind: ErrorKind, msg: T) -> Self + /// Construct a workspaces [`Error`] with the details of an error which includes + /// the custom error message with further context and the [`ErrorKind`] that + /// represents the category of error. + pub fn message(kind: ErrorKind, msg: T) -> Self where T: Into>, { @@ -73,7 +82,9 @@ impl Error { } } - pub(crate) fn simple(kind: ErrorKind) -> Self { + /// Construct a workspaces [`Error`] with the details of an error which only + /// includes the [`ErrorKind`] that represents the category of error. + pub fn simple(kind: ErrorKind) -> Self { Self { repr: ErrorRepr::Simple(kind), } diff --git a/workspaces/src/error/mod.rs b/workspaces/src/error/mod.rs index 2aadd5a4..02492aec 100644 --- a/workspaces/src/error/mod.rs +++ b/workspaces/src/error/mod.rs @@ -27,6 +27,9 @@ pub enum ErrorKind { /// An error from converting data. #[error("DataConversion")] DataConversion, + /// An error that cannot be categorized into the other error kinds. + #[error("Other")] + Other, } #[derive(Debug, thiserror::Error)]