scoped-error
Structured error handling with semantic context trees. Zero proc-macros. Zero backtrace overhead.
This library provides error_plus::Error, a context-aware error type for
idiomatic error handling with virtual backtraces - semantic breadcrumbs
attached exactly where they matter.
Philosophy
Explicit context over automatic backtraces. Instead of capturing 50
frames of stack on every error, error_plus lets you attach meaningful
context at semantic boundaries. The result is information-dense,
user-facing error reports without runtime overhead.
Quick Start
use FromStr;
use ;
;
Output:
Error: loading configuration, at src/main.rs:27:20
|-- reading file, at src/main.rs:15:12
`-- No such file or directory (os error 2)
Multiple Concurrent Failures
Unlike most error libraries, error_plus natively handles parallel
operations with Many:
use Many;
let results = vec!;
let values = from_results?;
Output:
Error: batch operation failed, at src/main.rs:10:5 (3 errors)
|-- task A failed, at src/worker.rs:8:9
| `-- connection timeout
|-- task B failed, at src/worker.rs:12:9
| `-- invalid response
`-- task C failed, at src/worker.rs:16:9
`-- parse error
Why error_plus?
| Feature | error_plus | Others |
|---|---|---|
| Semantic context | Scoped closures, zero-cost | Per-? .context() calls |
| Multiple causes | Native tree support (Many) | Linear chains only |
| Compile time | Fast, no proc-macros | Slower with derives |
| Backtraces | Virtual via context | Automatic, always-on overhead |
License
MIT OR Apache-2.0