-
Notifications
You must be signed in to change notification settings - Fork 12
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
Update: add catch blocks to handle exceptions #39
base: master
Are you sure you want to change the base?
Conversation
lib/ApiHelper.js
Outdated
@@ -116,6 +116,8 @@ class ApiHelper { | |||
} | |||
credentials = data.credentials; | |||
this.cred.sessionId = credentials.sessionId; | |||
}).catch(err => { | |||
throw err; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tranjennie What issue does catching and re-throwing the err fix? We should add a unit test to cover this senario if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@beefo I've removed this code. After some testing, I see that this was not catching any errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is a legitimate fix here, please add a unit test for it.
No description provided.