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

Should stop catching all errors and instead callback with them. #20

Open
oveddan opened this issue Sep 25, 2012 · 2 comments
Open

Should stop catching all errors and instead callback with them. #20

oveddan opened this issue Sep 25, 2012 · 2 comments

Comments

@oveddan
Copy link
Contributor

oveddan commented Sep 25, 2012

The module's method of having wide try catch blocks and returning errors is not typical for node, and it leaves bugs undiscovered or harder to track down. It should either not catch the errors, or callback with them.

@ammmir
Copy link
Owner

ammmir commented Sep 28, 2012

i only see two occurrences of try/catch, both of which are narrow in scope and intended to guard against invalid data being fed into JSON.parse as used inside the serializer module, which also throws when encountering a bad HMAC.

@oveddan
Copy link
Contributor Author

oveddan commented Sep 28, 2012

I would narrow the scope of the try catch block to just be wrapped around the serialization/deserialization part, and if it catches it, callback with the error rather than returning it.

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

No branches or pull requests

2 participants