Skip to content

docs: Add error handling section with examples #561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025
Merged

Conversation

simoneb
Copy link
Member

@simoneb simoneb commented May 21, 2025

Adds a new "Error Handling" section to the README.md.

This section explains how to catch TokenError exceptions and inspect the code property to determine the specific error. It includes code examples for handling:

  • Expired tokens (FAST_JWT_EXPIRED)
  • Invalid signatures due to key mismatch (FAST_JWT_INVALID_SIGNATURE)

Resolves #560 by providing documentation on how to handle common token verification errors.

Adds a new "Error Handling" section to the README.md.

This section explains how to catch `TokenError` exceptions and inspect
the `code` property to determine the specific error. It includes
code examples for handling:
- Expired tokens (`FAST_JWT_EXPIRED`)
- Invalid signatures due to key mismatch (`FAST_JWT_INVALID_SIGNATURE`)

Addresses issue #560 by providing documentation on how to handle
common token verification errors.
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. documentation Improvements or additions to documentation labels May 21, 2025
@simoneb simoneb requested a review from Copilot May 21, 2025 08:28
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds a new "Error Handling" section to the README.md, providing documentation and examples on how to manage token verification errors, including token expiration and invalid signature scenarios.

  • Added an "Error Handling" section to explain the use of TokenError and its code property.
  • Included two code examples demonstrating error handling for expired tokens and invalid signatures.

@clabene
Copy link

clabene commented May 21, 2025

LGTM - I tested the examples, they run as expected

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 22, 2025
@simoneb simoneb merged commit 2181bf1 into master May 22, 2025
8 of 9 checks passed
@simoneb simoneb deleted the docs-error-handling branch May 22, 2025 07:51
@github-actions github-actions bot mentioned this pull request May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add docs for token error handling
2 participants