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

clarify how to log #29

Closed RafaelKa closed 6 years ago

RafaelKa commented 6 years ago

we need to log some fails in byte stream e.g.:

  1. https://github.com/RafaelKa/node-serialport-enocean-parser/blob/25145346ff5c38e7e1e26397366565fde403cbbf/ESP3Parser.js#L58-L69
  2. https://github.com/RafaelKa/node-serialport-enocean-parser/blob/25145346ff5c38e7e1e26397366565fde403cbbf/ESP3Parser.js#L93-L105
Holger-Will commented 6 years ago

process.stderr.write() or console.error() ?

Holger-Will commented 6 years ago

or better yet this.emit('error', err)); so users can handle the error downstream and we don't clutter the console... https://nodejs.org/api/stream.html#stream_errors_while_reading