Expand description
A utility library for wrapping arbitrary errors, and for “throwing” errors in a way that can be caught by user-defined error hooks.
Structs§
- Error
- A generic wrapper for any error.
- Error
Hook Future - A
Future
that reads the error hook that is set when it is created, and sets this as the current error hook whenever it is polled. - ErrorId
- A unique identifier for an error. This is returned when you call
throw
, which calls a global error handler. - Reset
Error Hook OnDrop - Resets the error hook to its previous state when dropped.
Traits§
- Error
Hook - Implements behavior that allows for global or scoped error handling.
Functions§
- clear
- Clears the given error from the current error hook.
- get_
error_ hook - Returns the current error hook.
- set_
error_ hook - Sets the current thread-local error hook, which will be invoked when
throw
is called. - throw
- Invokes the error hook set by
set_error_hook
with the given error.