Evitable
Evitable is a library for easily creating and using custom
error types in libraries. It's intended to make the creation
of custom domain specific error types easier, as well as
reduce the noise related to converting from underlying errors
to domain specific errors, while keeping the underlying error
as source()
. This crate by default has a feature called
derive
enabled, which enables deriving ErrorContexts.
Quick example
This example showcases a typical usecase of calling some API that (pretends) to read a file, only to fail, and then converts the error into a domain specific error.
use *;
// Typically, this is in another file
use *;
// pretend token type
// main function
let result = parse_file;
let err = result.unwrap_err;
assert_eq!;