TimelordUK / jspurefix

native typescript FIX engine
MIT License
60 stars 28 forks source link

Error handling improvements #47

Closed hmvs closed 2 years ago

hmvs commented 2 years ago
  1. I believe that only errors that are unhandled should be written to the logger.error and it is up to the developer who uses the library to handle them or not. Otherwise, we end up logging errors multiple times. For instance, we have our developers notified if there was an unhandled error in the code. In case when it is logged into error inside the library we can't distinguish if it is handled error or not.

  2. I've changed the code where we are rejecting a promise if a timeout happens while connecting. Now we save the error and throw it instead of just a new error. Use case: we want to understand what was the error by analyzing the original socket error code, so we can understand that it was socket error and react in code accordingly if we want to retry or not.

TimelordUK commented 2 years ago

looks good thanks for the improvements