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

[PM-2076] Properly handle error responses in send_identity_connect_request #109

Merged
merged 4 commits into from
Jul 17, 2023

Conversation

Hinton
Copy link
Member

@Hinton Hinton commented Jul 17, 2023

Type of change

- [x] Bug fix
- [ ] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Ensure any server error is handled properly in the SDK instead of silently ignored by converting it to an error using reqwest error_for_status fn.

Resolves #87

A network error now resolves into

Error:
   0: HTTP status server error (504 Gateway Timeout) for url (https://localhost:8080/identity/connect/token)

Before you submit

  • Please add unit tests where it makes sense to do so (encouraged but not required)

@Hinton Hinton requested a review from dani-garcia July 17, 2023 10:20
@bitwarden-bot
Copy link

bitwarden-bot commented Jul 17, 2023

Logo
Checkmarx One – Scan Summary & Detailscada53c5-16e9-43e3-9d2a-230bbce3bf67

No New Or Fixed Issues Found

dani-garcia
dani-garcia previously approved these changes Jul 17, 2023
Copy link
Member

@dani-garcia dani-garcia left a comment

Choose a reason for hiding this comment

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

There might be some cases where we'd get better error messages by parsing the response body, for example when receiving a generic error like 400 Bad Request. That said this should better than what we have now

Copy link
Member

@dani-garcia dani-garcia left a comment

Choose a reason for hiding this comment

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

LGTM, eventually we might want to parse the output to differentiate specific errors, but this is much better already than "Failed to parse Response"

@Hinton Hinton enabled auto-merge (squash) July 17, 2023 14:42
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.

Failed to parse IdentityTokenResponse
3 participants