w3st-io / trading-bot

Coinbase Trading Bot
0 stars 1 forks source link

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

Open jkahanec opened 4 years ago

jkahanec commented 4 years ago

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 https://github.com/aleem-ahmed/eccentric-trader/issues/1 but I thought it was a good thing to mention anyways.)