Expand description
Generic error handling for Tectonic.
This crate provides a generic boxed error type, plus supporting utilities. In particular:
- The basic
Errortype is ananyhow1.x boxed Error - The
atry!macro allows simple structured annotations to be added to?operations - The
a_ok_or!macro allows for annotations toOption::ok_or_elsecalls.
Re-exports§
pub use anyhow;
Modules§
- prelude
- A “prelude” module providing a collection of useful names, without causing compiler complaints about the ones you don’t use.
Macros§
- a_ok_or
- “annotated ok_or” — like
Option::ok_or_else()?, but with the ability to add extended context to the error. This yields anAnnotatedMessageas its error type. - atry
- “Annotated try” — like
try!, but with the ability to add extended context to the error message. This tries to provide a bit more syntactic sugar than anyhow’swith_context(), and it supports our AnnotatedMessage context type.
Structs§
- Annotated
Message - A simple annotated message that can be attached to errors using the
anyhow::Contextmethods, or be used as an error type itself. The recommended way to use this for error context is usingatry!or related macros. - Error
- The generic error type, for complex operations that can fail for a wide
range of reasons. This type is a reexport of the
anyhow1.x series Error type.
Type Aliases§
- Result
- A preloaded result type where the error type is our generic error type.
Result<T, Error>