Commit fc3f207
fix: handle 400 errors without rejecting promise
Changed the request method to resolve (not reject) when receiving a 400
Bad Request error. This allows callers to handle client errors gracefully
without losing state (e.g., PKCE code verifier). Callers can check
response.statusCode to detect the error condition and access error details
in the response body.
- 200-299: Success - resolves with deserialized body
- 400: Client error - resolves with raw error body
- 401-599: Other errors - rejects with HttpError
This prevents state loss when 400 errors occur in OAuth/PKCE flows.
Co-authored-by: Subterrane <5290140+Subterrane@users.noreply.github.com>1 parent 8253e38 commit fc3f207
1 file changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
254 | 261 | | |
| 262 | + | |
255 | 263 | | |
256 | 264 | | |
257 | 265 | | |
| |||
0 commit comments