mirror of
https://github.com/meshcore-dev/meshcore.js.git
synced 2026-04-20 22:13:49 +00:00
Refactor error handling to use arrow function
This commit is contained in:
parent
82703bc9f3
commit
77d523e1de
1 changed files with 3 additions and 3 deletions
|
|
@ -30,9 +30,9 @@ class NodeJSSerialConnection extends SerialConnection {
|
|||
this.onDisconnected();
|
||||
});
|
||||
|
||||
this.serialPort.on("error", function(err) {
|
||||
console.error("SerialPort Error: ", err.message);
|
||||
this.emit("error", err);
|
||||
this.serialPort.on("error", (error) => {
|
||||
console.error("SerialPort Error: ", error.message);
|
||||
this.emit("error", error);
|
||||
});
|
||||
|
||||
this.serialPort.on("data", async (data) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue