This repository was archived by the owner on Sep 4, 2024. It is now read-only.
Commit 090dc0f
committed
Merge #103: minreq_http: return an HTTP error on error with no JSON in body
66fb441 minreq_http: return an HTTP error on error with no JSON in body (Antoine Poinsot)
Pull request description:
It is useful for downstream users to be matching on errors that do not contain a valid JSONRPC error in the HTTP response body. One instance is if the HTTP server work queue depth is exceeded, as they probably want to retry the request later.
On such error we would return a JSON deserialization error, without exposing neither the HTTP status code nor the body of the response. This made it impossible to detect such transient errors.
Instead, introduce a new HttpError variant that gets returned when the requested is responded to by an error that does not contain valid JSON in its body.
See also: #94 (comment).
ACKs for top commit:
apoelstra:
ACK 66fb441
Tree-SHA512: 76c831331c3b84e2f4319d62828b18574fd6af39a49c98d06c0c5a9c7833c828c9e02522b635a52f289e149cfc0a1abc160ac18d5edaf36114126186d39f4e0b1 file changed
+40
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | | - | |
71 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
72 | 86 | | |
73 | 87 | | |
74 | 88 | | |
| |||
156 | 170 | | |
157 | 171 | | |
158 | 172 | | |
159 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
160 | 193 | | |
161 | 194 | | |
162 | 195 | | |
163 | 196 | | |
164 | 197 | | |
165 | 198 | | |
| 199 | + | |
| 200 | + | |
166 | 201 | | |
167 | 202 | | |
168 | 203 | | |
169 | 204 | | |
170 | 205 | | |
171 | 206 | | |
172 | 207 | | |
| 208 | + | |
173 | 209 | | |
174 | 210 | | |
175 | 211 | | |
| |||
181 | 217 | | |
182 | 218 | | |
183 | 219 | | |
| 220 | + | |
184 | 221 | | |
185 | 222 | | |
186 | 223 | | |
| |||
0 commit comments