Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new chapter for Error Reporting #21

Merged
merged 2 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 79 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ serde = {version = "1", features = ["derive"] }
itertools = "0.11.0"
serde_json = "1"
anyhow = "1"
datetime = "0.5.2"
datetime = "0.5.2"
sha1 = "0.10.6"
5 changes: 3 additions & 2 deletions content/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@

- [Associated Types](associated-types.md)
- [Error Handling](error-handling.md)
- [Delegated Error Raiser](delegated-error-raiser.md)
- [Detailed Error Reporting]()
- [Delegated Error Raisers](delegated-error-raiser.md)
- [Error Reporting](error-reporting.md)
- [Wrapping Errors]()
- [Component Presets]()
- [Trait-Generic Providers]()
- [`WithProvider`]()
Expand Down
4 changes: 2 additions & 2 deletions content/delegated-error-raiser.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Delegated Error Raiser
# Delegated Error Raisers

In the previous chapter, we have defined context-generic error raisers like `RaiseFrom`
and `DebugAsAnyhow`, which can be use to raise any source error that satisfy certain
Expand All @@ -13,7 +13,7 @@ For example, we may want to use `RaiseFrom` when there is a `From` instance, and
In this chapter, we will cover the `UseDelegate` pattern, which offers a declarative
way to handle errors differently depending on the source error type.

## Ad Hoc Error Raiser
## Ad Hoc Error Raisers

One way that we can handle source errors differently is by defining an error raiser
provider that has explicit implementation for each source error, such as follows:
Expand Down
Loading
Loading