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

fix(errors): wrap errors from external authenticators to use new system #214

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

dpopp07
Copy link
Member

@dpopp07 dpopp07 commented Apr 8, 2024

External authenticators may not use our error types. We previously assumed that errors coming from the Authenticate method would be either an AuthenticationError or SDKProblem and performed a type-cast that could cause a panic. This makes the type checking more explicit, and in the case of an unexpected error type, wraps the error in a new SDKProblem object and returns it to keep our error types consistent.

External authenticators may not use our error types. We previously assumed
that errors coming from the `Authenticate` method would be either an
`AuthenticationError` or `SDKProblem` and performed a type-cast that could
cause a panic. This makes the type checking more explicit, and in the case
of an unexpected error type, wraps the error in a new SDKProblem object and
returns it to keep our error types consistent.

Signed-off-by: Dustin Popp <dpopp07@gmail.com>
@dpopp07 dpopp07 requested a review from padamstx April 8, 2024 21:50
Copy link
Member

@padamstx padamstx left a comment

Choose a reason for hiding this comment

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

LGTM

@dpopp07 dpopp07 merged commit c74778e into main Apr 8, 2024
4 checks passed
@dpopp07 dpopp07 deleted the dp/fix-cast branch April 8, 2024 21:57
ibm-devx-sdk pushed a commit that referenced this pull request Apr 8, 2024
## [5.16.4](v5.16.3...v5.16.4) (2024-04-08)

### Bug Fixes

* **errors:** wrap errors from external authenticators to use new system ([#214](#214)) ([c74778e](c74778e))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 5.16.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

None yet

3 participants