Skip to content

Conversation

dpopp07
Copy link
Contributor

@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
Contributor

@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
@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.

3 participants