Commit 75eae87
feat!: concrete errors (#3161)
## Description
Fixes #2741
Uses `snafu` to create concrete errors with backtracing.
We no longer use `anyhow` in our APIs, all errors returned from API
functions and methods are concrete.
We also use `n0-snafu` (an number 0 maintained crate that adds additional traits that work makes working with the concrete snafu errors easier) in place of `anyhow` or `testresult` in testing and examples.
## Breaking Changes
`iroh`
- `changed`
- `iroh::discovery::Lagged` changed from a tuple to a struct
- `iroh::watcher::Disconnected` is changed from a tuple to a struct
- `iroh::watcher::Disconnected` is no longer `UnwindSafe` or
`RefUnwindSafe`
- `iroh::watcher::InitializedFut` is no longer `RefUnwindSafe`
`iroh-base`
- `changed`
- `iroh_base::ticket::Error` is renamed to
`iroh_base::ticket::ParseError`
- `iroh_base::key::KeyParsingError` has changed from a `thiserror` error
to a `snafu` error
`iroh-relay`
- `changed`
- `iroh_relay::node_info::MaxLengthExceededError` is no longer
`UnwindSafe` or `RefUnwindSafe`
- `iroh_relay::node_info::MaxLengthExceededError` was changed from a
`thiserror` to a `snafu` error
- `iroh_relay::client::ConnSendError` is now
`iroh_relay::client::SendError`
- `iroh_relay::protos::stun::Error` is now
`iroh_relay::protos::stun::StunError`
## Notes & open questions
<!-- Any notes, remarks or open questions you have to make about the PR.
-->
## Change checklist
- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.
---------
Co-authored-by: Rüdiger Klaehn <[email protected]>
Co-authored-by: Philipp Krüger <[email protected]>
Co-authored-by: Kasey <[email protected]>
Co-authored-by: “ramfox” <“[email protected]”>1 parent e36ac77 commit 75eae87
File tree
92 files changed
+3659
-1948
lines changed- .github/workflows
- iroh-base
- src
- ticket
- iroh-dns-server
- benches
- examples
- src
- dns
- http
- doh
- store
- iroh-relay
- proptest-regressions/protos
- src
- client
- protos
- server
- iroh
- bench
- src
- bin
- examples
- src
- discovery
- pkarr
- magicsock
- net_report
- reportgen
- tls
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
92 files changed
+3659
-1948
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | | - | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
52 | | - | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
183 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
184 | 193 | | |
185 | 194 | | |
186 | | - | |
187 | | - | |
| 195 | + | |
| 196 | + | |
188 | 197 | | |
189 | | - | |
190 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
191 | 202 | | |
192 | | - | |
193 | | - | |
| 203 | + | |
| 204 | + | |
194 | 205 | | |
195 | 206 | | |
196 | 207 | | |
| |||
333 | 344 | | |
334 | 345 | | |
335 | 346 | | |
336 | | - | |
| 347 | + | |
337 | 348 | | |
338 | 349 | | |
339 | 350 | | |
340 | 351 | | |
341 | 352 | | |
342 | 353 | | |
343 | | - | |
| 354 | + | |
344 | 355 | | |
345 | 356 | | |
346 | 357 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
0 commit comments