mirror of
https://github.com/meshcore-dev/meshcore.js.git
synced 2026-04-20 22:13:49 +00:00
Merge 77d523e1de into 306dadac1c
This commit is contained in:
commit
37d424b8b8
2 changed files with 4 additions and 2 deletions
|
|
@ -30,8 +30,9 @@ class NodeJSSerialConnection extends SerialConnection {
|
|||
this.onDisconnected();
|
||||
});
|
||||
|
||||
this.serialPort.on("error", function(err) {
|
||||
console.log("SerialPort Error: ", err.message)
|
||||
this.serialPort.on("error", (error) => {
|
||||
console.error("SerialPort Error: ", error.message);
|
||||
this.emit("error", error);
|
||||
});
|
||||
|
||||
this.serialPort.on("data", async (data) => {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ class TCPConnection extends Connection {
|
|||
// handle errors
|
||||
this.socket.on('error', (error) => {
|
||||
console.error('Connection Error', error);
|
||||
this.emit("error", error);
|
||||
});
|
||||
|
||||
// handle socket close
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue