Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/augustocdias/bail-out
Macros to help keep code clean for validations and error handling
https://github.com/augustocdias/bail-out
error-handling rust
Last synced: about 2 months ago
JSON representation
Macros to help keep code clean for validations and error handling
- Host: GitHub
- URL: https://github.com/augustocdias/bail-out
- Owner: augustocdias
- License: mit
- Created: 2021-01-13T14:24:19.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-15T15:56:37.000Z (almost 4 years ago)
- Last Synced: 2024-10-07T23:08:05.078Z (3 months ago)
- Topics: error-handling, rust
- Language: Rust
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bail Out
This library is inspired in the `ensure` and `bail` macros from `anyhow`. The difference is that it is not tied to anyhow's types.
Many libraries have their own error types and using the anyhow's `ensure` macro doesn't work because it returns an anyhow error. This library intends to work with any type.
This library also provides the `assure` macro, that does the same but evaluates to a `Result` instead of returning. This is useful for using inside `try` blocks.
Please check the docs for usage.