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

Don't catch exceptions just to log them. #2

Open
jkahanec opened this issue Aug 10, 2020 · 0 comments
Open

Don't catch exceptions just to log them. #2

jkahanec opened this issue Aug 10, 2020 · 0 comments

Comments

@jkahanec
Copy link
Collaborator

https://github.com/aleem-ahmed/eccentric-trader/blob/0691dce6c969561bb316a21b45a4296e3b030437/client/coinbase/CBAuthClient.js#L29-L30

Generally, you should avoid catching exceptions and not handling them. At least you added a log statement, so you would know it's happening.

Think carefully if you really want to only log the error. When this method is used by another class and it fails, will that class be able to handle it correctly?

(Note: I know that I mentioned to get rid of this class in #1 but I thought it was a good thing to mention anyways.)

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

1 participant