Commit 0699540
fix(oauth): improve refresh-token error message; remove 'please' and dead placeholder
The CDK's DeclarativeOauth2Authenticator surfaced a refresh-token
error as 'Refresh token is invalid or expired. Please re-authenticate
from Sources/<your source>/Settings.' That message violates the
writing-good-error-messages guidelines on multiple counts:
- Remediation embedded in the user-facing string ('Please re-authenticate ...')
- 'Please' emotional/blame language
- Literal '<your source>' placeholder that never gets substituted
- Over-claims 'invalid or expired' when the 4xx may actually be a
malformed refresh request (e.g. Gong's generate-customer-token
endpoint, tracked in airbytehq/airbyte-internal-issues#16467)
The new message states only the observed condition without
over-claiming the cause or instructing the user to take an action
that may not resolve the failure. The internal_message now also
captures the HTTP status code so developers debugging logs can
see the upstream response status.
Resolves airbytehq/airbyte-internal-issues#16468
Co-Authored-By: bot_apk <apk@cognition.ai>1 parent a7b0929 commit 0699540
2 files changed
Lines changed: 13 additions & 5 deletions
File tree
- airbyte_cdk/sources/streams/http/requests_native_auth
- unit_tests/sources/streams/http/requests_native_auth
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
309 | 309 | | |
310 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
311 | 317 | | |
312 | 318 | | |
313 | 319 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | | - | |
579 | | - | |
580 | | - | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
581 | 583 | | |
582 | 584 | | |
583 | 585 | | |
| |||
0 commit comments