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

Update: add catch blocks to handle exceptions #39

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tranjennie
Copy link

No description provided.

package.json Outdated Show resolved Hide resolved
lib/ApiHelper.js Outdated
@@ -116,6 +116,8 @@ class ApiHelper {
}
credentials = data.credentials;
this.cred.sessionId = credentials.sessionId;
}).catch(err => {
throw err;
Copy link
Contributor

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.

Copy link
Author

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

Copy link
Contributor

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?

Copy link
Contributor

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.

package.json Outdated Show resolved Hide resolved
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.

2 participants