5 releases (stable)

1.1.0 Mar 13, 2023
1.0.7 Mar 13, 2023
1.0.1 Feb 2, 2023
0.1.1 Feb 2, 2023
0.1.0 Feb 1, 2023

#1260 in Rust patterns

Apache-2.0

8KB
121 lines

Curerr v1.1.0

  • A crate for error handling

Documentation

Changelog

  • Added Call, Data option for CursedError
  • Added NotSupported option for CursedErrorType
  • Renamed CursedError enum option Argument to Input

v1.0.6 yank reasons

  • CursedError implementation wasn't complete
  • Documentation was old

Example

fn devide(a: i32, b: i32) -> Result<i32, CursedErrorHandle> {
    if b == 0 {
        return Err(CursedErrorHandle::new(
            CursedError::Argument(CursedErrorType::Invalid),
            "0 division!!!".to_string()
        ))
    }

    Ok(a/b)
}

let result = devide(6, 3).expect("division error");

No runtime deps