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: do not cache 200 requests with bad JSON #852

Closed

Conversation

oleksandrpravosudko-okta
Copy link
Contributor

Copy link
Contributor

@shuowu shuowu left a comment

Choose a reason for hiding this comment

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

One comment per error handling, please also add changelog for this PR.

@@ -72,7 +72,7 @@ function fetchRequest(method: string, url: string, args: FetchOptions) {
return formatResult(status, data);
})
.then(result => {
if (error) {
if (error || result.responseJSON?.error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

how about throwing different errors for 200 and not 200, so it can provide meaningful debugging information for both devs and our support team.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it looks like error object already includes information about request status

eng-prod-CI-bot-okta pushed a commit that referenced this pull request Jul 6, 2021
doc: add changelog entry for future minor version

OKTA-395479
<<<Jenkins Check-In of Tested SHA: f62f800 for eng_productivity_ci_bot_okta@okta.com>>>
Artifact: okta-auth-js
Files changed count: 3
PR Link: "#852"
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.

None yet

3 participants