13 releases (8 breaking)

0.9.1 Oct 15, 2024
0.9.0-alpha Jul 26, 2024
0.8.2 Sep 12, 2024
0.7.0 Mar 27, 2024
0.3.0 May 30, 2023

#413 in Rust patterns

Download history 70/week @ 2024-12-18 73/week @ 2024-12-25 133/week @ 2025-01-01 192/week @ 2025-01-08 142/week @ 2025-01-15 266/week @ 2025-01-22 230/week @ 2025-01-29 231/week @ 2025-02-05 105/week @ 2025-02-12 273/week @ 2025-02-19 189/week @ 2025-02-26 121/week @ 2025-03-05 124/week @ 2025-03-12 79/week @ 2025-03-19 205/week @ 2025-03-26 204/week @ 2025-04-02

624 downloads per month
Used in 2 crates

MIT license

36KB
1K SLoC

bigerror 🍅🍆🥒

Errors should be composed of reusable parts to make readability consistent.

example

What if handling an error also produces an error?

code:

https://github.com/knox-networks/bigerror/blob/51686e4e42397f4275335a54286210e705ab8ea7/src/lib.rs#L822-L838

command (try it yourself):

$ cargo test -- test::error_in_error_handling --nocapture

output:

image

extra

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,
);

Dependencies

~0.9–1.7MB
~32K SLoC