Update: add catch blocks to handle exceptions#39
Open
tranjennie wants to merge 3 commits intoGeotab:masterfrom
Open
Update: add catch blocks to handle exceptions#39tranjennie wants to merge 3 commits intoGeotab:masterfrom
tranjennie wants to merge 3 commits intoGeotab:masterfrom
Conversation
beefo
reviewed
Jul 27, 2022
beefo
reviewed
Jul 27, 2022
lib/ApiHelper.js
Outdated
| credentials = data.credentials; | ||
| this.cred.sessionId = credentials.sessionId; | ||
| }).catch(err => { | ||
| throw err; |
Contributor
There was a problem hiding this comment.
@tranjennie What issue does catching and re-throwing the err fix? We should add a unit test to cover this senario if possible.
Author
There was a problem hiding this comment.
@beefo I've removed this code. After some testing, I see that this was not catching any errors
Contributor
There was a problem hiding this comment.
@tranjennie there are a bunch more of the same catch and re-thow paterns added.
.catch(err => {
throw err;
});
If the one above didn't do anything, I assume the other don't do anything?
If we remove all of these, there's no change here as far as I can tell. What precisely are we fixing here?
Contributor
There was a problem hiding this comment.
If there is a legitimate fix here, please add a unit test for it.
beefo
reviewed
Jul 27, 2022
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.
No description provided.