Skip to content

♻️ Improve how we handle invalid tokens#153

Merged
patrick91 merged 1 commit intomainfrom
improve-how-we-handle-invalid-tokens
Feb 12, 2026
Merged

♻️ Improve how we handle invalid tokens#153
patrick91 merged 1 commit intomainfrom
improve-how-we-handle-invalid-tokens

Conversation

@patrick91
Copy link
Collaborator

@patrick91 patrick91 commented Feb 10, 2026

Deletes the existing tokens when we get a 401

Stack

@patrick91 patrick91 force-pushed the isolate-tests-from-config branch 2 times, most recently from 8449177 to 19256d8 Compare February 10, 2026 11:31
@patrick91 patrick91 force-pushed the improve-how-we-handle-invalid-tokens branch 2 times, most recently from 7c411fd to 314a0e7 Compare February 10, 2026 14:24
Comment on lines +92 to +96
if e.status_code == 404:
message = "App not found. Make sure to use the correct account."

elif isinstance(e.__cause__, HTTPError):
message = handle_http_error(e.__cause__)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking of turning StramLogError into an HTTPError, but I would love to still retain "App not found. Make sure to use the correct account.", I might do some more refactoring in another PR (my current ideas is that we could pass a Mapping[StatusCode, ErrorMessage] to handle_http_error)

@patrick91 patrick91 requested a review from buurro February 10, 2026 14:27
@patrick91 patrick91 force-pushed the isolate-tests-from-config branch from 19256d8 to 1c6abfe Compare February 10, 2026 14:31
@patrick91 patrick91 force-pushed the improve-how-we-handle-invalid-tokens branch 2 times, most recently from 769a318 to 2c9e0ca Compare February 10, 2026 14:34
@patrick91 patrick91 marked this pull request as ready for review February 10, 2026 14:35
Base automatically changed from isolate-tests-from-config to main February 10, 2026 14:58
@patrick91 patrick91 force-pushed the improve-how-we-handle-invalid-tokens branch 2 times, most recently from 18b2573 to ba30f49 Compare February 11, 2026 14:02
@patrick91 patrick91 force-pushed the improve-how-we-handle-invalid-tokens branch 4 times, most recently from 4b7b2cf to f686471 Compare February 11, 2026 16:00
@patrick91 patrick91 force-pushed the improve-how-we-handle-invalid-tokens branch from f686471 to 1412b7d Compare February 12, 2026 10:28
@patrick91 patrick91 requested a review from buurro February 12, 2026 10:30
@patrick91 patrick91 merged commit a992116 into main Feb 12, 2026
14 checks passed
@patrick91 patrick91 deleted the improve-how-we-handle-invalid-tokens branch February 12, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants