That's interesting - that behaviour is expected though.
The error callback will get called in case of connection errors, but not for an error like that which is caused by a call on the socket.
While it makes sense to have it behave the same as Node.js, I'd say the current behaviour is actually pretty useful - it really helps to have a stack trace from the offending line of code.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
That's interesting - that behaviour is expected though.
The error callback will get called in case of connection errors, but not for an error like that which is caused by a call on the socket.
While it makes sense to have it behave the same as Node.js, I'd say the current behaviour is actually pretty useful - it really helps to have a stack trace from the offending line of code.