Crate throw_error

Source
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.
ErrorHookFuture
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.
ResetErrorHookOnDrop
Resets the error hook to its previous state when dropped.

Traits§

ErrorHook
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.