Error Codes - make error details more transparent to users of jwt-auth#53
Merged
macdonst merged 1 commit intoadobe:masterfrom Apr 23, 2021
brenthosie:error-codes-fix-swallowing
Merged
Error Codes - make error details more transparent to users of jwt-auth#53macdonst merged 1 commit intoadobe:masterfrom brenthosie:error-codes-fix-swallowing
macdonst merged 1 commit intoadobe:masterfrom
brenthosie:error-codes-fix-swallowing
Conversation
brenthosie
commented
Apr 23, 2021
| } else { | ||
| throwRequestFailedError(res.statusText); | ||
| } | ||
| return res.json().then(data => { |
Member
Author
There was a problem hiding this comment.
I think it's desirable to let res.json throw if there's something wrong, This gives us a stack trace and insight that there was something wrong doing the exchange. In this scenario, we would already have made the roundtrip, so let's figure out why it blew up.
Allows transparent error details to bubble back to the caller of auth().
brenthosie
commented
Apr 23, 2021
| if (res.ok) { | ||
| return res.json(); | ||
| } else { | ||
| throwRequestFailedError(res.statusText); |
Member
Author
There was a problem hiding this comment.
delete the throwRequestFailedError here and let the details emerge near lines 123-130
10 tasks
macdonst
approved these changes
Apr 23, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When #52 was merged, it contains code that swallows helpful information from IMS for the thrown error. Bubble those details back up.
Related Issue
#52, #11, #9
Motivation and Context
Better messaging for users of jwt-auth for by the token exchange isn't working
How Has This Been Tested?
npm testScreenshots (if appropriate):
Types of changes
Checklist: