Skip to content
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

chore: Error handling for decrypt() #541

Merged
merged 1 commit into from
Oct 25, 2024
Merged

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Oct 25, 2024

What does this PR do?

  • Wraps decrypt() in a try/catch
  • Currently, if decryption fails, an unhandled exception brings down Express
  • This now ensures it's handled gracefully, and the consumer needs to check the existence of they keys (the function still maintains it's signature of returning string | undefined for a secret)

To test

image image image

@DafyddLlyr DafyddLlyr changed the title wip: Test most basic error handling chore(wip): Error handling for decrypt() and encrypt() utils Oct 25, 2024
@DafyddLlyr DafyddLlyr force-pushed the dp/decrypt-error-handling branch from 4948164 to a127b1d Compare October 25, 2024 09:48
@DafyddLlyr DafyddLlyr changed the title chore(wip): Error handling for decrypt() and encrypt() utils chore: Error handling for decrypt() Oct 25, 2024
@DafyddLlyr DafyddLlyr requested a review from a team October 25, 2024 10:03
@DafyddLlyr DafyddLlyr marked this pull request as ready for review October 25, 2024 10:10
@DafyddLlyr DafyddLlyr force-pushed the dp/decrypt-error-handling branch from a127b1d to 24b6656 Compare October 25, 2024 10:25
Copy link
Member

@jessicamcinchak jessicamcinchak left a comment

Choose a reason for hiding this comment

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

Perfect thanks !

@DafyddLlyr DafyddLlyr merged commit 92ca7aa into main Oct 25, 2024
3 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/decrypt-error-handling branch October 25, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants