Commit 3aed4a6
authored
Expose reqwest's inner error in the
* Expose reqwest's inner error in the `fetch` function
We were converting the `reqwest::Error` type directly to `span::Error`
and the rendering chain stopped at that. This ignored the
inner (source) error which contained the most useful information to
figure out what went wrong.
This gets us from:
Error: error: failed to fetch: error: error decoding response body
to:
Error: error: failed to fetch: error: error decoding response body: missing field `discord` at line 16049 column 1
* Generate a spanned::Error directly from the inner JSON error
The code is shorter and less hacky. The end-user message looks much
better too.
* Use `to_string()` instead of `format!`
* Move the question mark out of `Ok(json_response?)`fetch function (#424)1 parent 62d06a3 commit 3aed4a6
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
126 | 134 | | |
127 | 135 | | |
0 commit comments