Skip to content

Commit 9a672e6

Browse files
authored
refactor!: various changes after review
- improved error printing: hide transparent errors in default view, but do display them in the debug view when locations are printed - add `try_e`, `try_any`, `ensure_e`, `bail`, `bail_any` macros - add context to anyerr macro - deprecate `whatever` macro, use `try_e` or `try_any` instead - deprecate `Err` macro, use `Err(e!(..))` insetad
2 parents 79fbfc5 + 652923b commit 9a672e6

File tree

7 files changed

+507
-201
lines changed

7 files changed

+507
-201
lines changed

examples/simple.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::io;
22

3-
use n0_error::{Err, StackError, e, meta};
3+
use n0_error::{StackError, e, meta};
44

55
use self::error::CopyError;
66
use crate::error::{InvalidArgsError, OperationError};
@@ -29,7 +29,7 @@ fn main() {
2929

3030
fn _some_fn() -> Result<(), CopyError> {
3131
// Err! macro works like e! but wraps in Err
32-
Err!(CopyError::Read, io::Error::other("yada"))
32+
Err(e!(CopyError::Read, io::Error::other("yada")))
3333
}
3434

3535
fn operation() -> Result<(), OperationError> {

0 commit comments

Comments
 (0)