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

Callback not receiving errors #72

Merged
merged 4 commits into from
Apr 4, 2018
Merged

Conversation

chadrickman
Copy link
Contributor

The callback was not being passed the error that was being thrown by node-growl. I changed the logic to first see if the error was set and if so pass that. If error is not set than resume the original logic of checking the code and returning null if it's 0 or the value of code if its greater than 0.

I wasn't sure if there was something that was relying on this logic, though there shouldn't be any cases now where the code would be greater than 0 and there not be an error.

This is my first PR, please let me know if I can provide any more details.

… error to the callback. I left the original logic of checking for a code, if error isn’t set.
@deiga
Copy link
Collaborator

deiga commented Apr 3, 2018

@chadrickman Thanks for your contribution!
Since a double ternary is a bit hard to read, could you rewrite it to be a bit more readable?

@chadrickman
Copy link
Contributor Author

@deiga - Ya. Actually, after reviewing node's documentation I realized that the child process would only ever return anything other than 0 if there is an error since in the event of an error we're returning the error, that code will never be reached. So I've removed the check and updated the unit tests to reflect that.

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