Refactor error handling to use arrow function

This commit is contained in:
Petr Severa 2025-11-18 13:27:18 +01:00 committed by GitHub
parent 82703bc9f3
commit 77d523e1de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) => {