Repository navigation
Commit de9d539
committed
[Doc] Bound the token endpoint error docs to what sets the readers
## Motivation and Context
The "Token endpoint errors" section opens with "When a token exchange or refresh fails", but the readers it describes
are set only when the token endpoint answers with a non-2xx response within the body cap: a transport failure, a body
over the cap, and a 2xx response with a broken body all raise `AuthorizationError` with `nil` readers. The section
also leaves unsaid that `InvalidGrantError` is chosen on the raw `error` while the `error` reader holds the sanitized
value, so a code the server padded, `"invalid_grant\n"` say, reads back as `error == "invalid_grant"` yet raises
`AuthorizationError`; a reader inferring the class from the reader would get it wrong. The section now states
the condition and the distinction.
The sentence that other authorization failures have `nil` readers predates the authorization callback error
of 1.7.0, which sets `error` and `error_description` with `http_status` left `nil`; the section now says so.
A blank diagnostic field reads as `nil` as well, since the sanitizer strips it; the section says so too.
## How Has This Been Tested?
Docs only. Both statements were checked against `token_endpoint_error` and `bounded_request` in
`lib/mcp/client/oauth/flow.rb`.
The callback sentence was checked against `authorization_response_error`.
## Breaking Changes
None.1 parent ec6501b commit de9d539
1 file changed
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
272 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
279 | 280 | | |
280 | | - | |
281 | | - | |
282 | | - | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
283 | 287 | | |
284 | 288 | | |
285 | 289 | | |
| |||
0 commit comments