Errors should be composed of reusable parts to make readability consistent.
What if handling an error also produces an error?
code:
Lines 822 to 838 in 51686e4
command (try it yourself):
$ cargo test -- test::error_in_error_handling --nocapture
output:
If just
is installed: just printerr-all
to visualize all unit test errors
-- This error crate is intended to
-- enhance error-stack:
-- https://hash.dev/blog/announcing-error-stack
-- error-stack `is_fantastic && does_things.in(|_a| functional(approach))` but
-- `error_stack::Report::change_context` can make code noisy when used often
--
-- ...so why not auto implement a bunch of `From<Error> for MyError`?
-- and provide fundamental building blocks such as `bigerror::NotFound`
-- to express common causes for errors and imply correlation?
CREATE CRATE IF NOT EXISTS
bigerror (
error BIGERROR NOT NULL,
);