node-oauth2-provider icon indicating copy to clipboard operation
node-oauth2-provider copied to clipboard

Should stop catching all errors and instead callback with them.

Open oveddan opened this issue 12 years ago • 2 comments

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.

oveddan avatar Sep 25 '12 03:09 oveddan

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.

ammmir avatar Sep 28 '12 07:09 ammmir

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.

oveddan avatar Sep 28 '12 23:09 oveddan