RafaelKa / node-serialport-enocean-parser

ESP3 parser for nodes serialport
Do What The F*ck You Want To Public License
6 stars 2 forks source link

add proper error handling and failure tests #47

Open Holger-Will opened 5 years ago

Holger-Will commented 5 years ago

check every function and method for proper error handling and add tests passing invalid data everywhere. I propose to try to recover from most bogus inputs as much as we can and only throw if absolutely necessary. For cases where we recover it's best to log somewhere and outside of the parser we are not in a stream so emit("error") does not work... :-( the question is again how to log.

Holger-Will commented 5 years ago

https://medium.com/front-end-hacking/error-handling-in-node-javascript-suck-unless-you-know-this-2018-aa0a14cfdd9d ?