Crates.io | errore |
lib.rs | errore |
version | |
source | src |
created_at | 2024-10-27 09:37:21.886905 |
updated_at | 2024-10-29 12:29:02.038531 |
description | Library for error handling and tracing |
homepage | |
repository | https://github.com/jpramosi/errore |
max_upload_size | |
id | 1424438 |
Cargo.toml error: | TOML parse error at line 24, column 1 | 24 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
This library provides a framework to handle and trace errors across modules and crates.
At the moment errore is in development and breaking changes are to be expected.
Examplary error output:
Error: example_basic::account::Authentication
├─▶ <example_basic::auth::ReadPassword> Invalid email or password
│ ├╴ examples/basic/src/auth.rs:20:8
│ ╰╴ examples/basic/src/auth.rs:24:8
│
╰─▶ <example_basic::account::Authentication>
╰╴ examples/basic/src/account.rs:20:5
Trace records:
<example_basic::auth::ReadPassword> Invalid email or password at examples/basic/src/auth.rs:20:8
<example_basic::auth::ReadPassword> Invalid email or password at examples/basic/src/auth.rs:24:8
<example_basic::account::Authentication> Invalid email or password at examples/basic/src/account.rs:20:5
Error display:
example_basic::account::Authentication: Invalid email or password
at examples/basic/src/auth.rs:20:8
Error extraction with 'match':
OS error code 2: entity not found
Error extraction with 'get()':
OS error code 2: entity not found
For more examples please see here.
backtrace
metadata
and error conversionSubscriber
and Formatter
interfaceExtensions
at subscriberthiserror
that allows to optionally
enable errore
in public distributed libraries.
example
no-std
support & wasm
compatibleResult
instrumentation are required#from
requires a trait implementation of std::error::Error
for the typewhere
keywordanyhow
support (shouldn't be a problem if errore
is used)thiserror
should be used.
errore
can be used as is. Errors are best declared on a per module basis.
errore
the various examples
can serve as a good foundationctor
: Utilizes link_sections provided by the ctor
and inventory
crates to offer a better implementation of the metadata and subscriber relevant code. The fallback implementation is based on lazy static variables.
This feature can be disabled at no-std
projects on build failures.debug-no-std
: Enables internal debug logging with the defmt
crate.debug-std
: Enables internal debug logging with the log
crate.std
: Enables standard library support. If the std
feature is not enabled, the alloc
crate is required.thiserror
which is used as errore`s foundation