ignore errors closing serial port

This commit is contained in:
liamcottle
2024-10-06 16:50:03 +13:00
parent 226936a5e5
commit a89ded61b0
2 changed files with 16 additions and 3 deletions

View File

@@ -765,7 +765,12 @@
// close port // close port
console.log("Closing serial port"); console.log("Closing serial port");
try {
await this.serialPort.close(); await this.serialPort.close();
} catch(e) {
console.log("failed to close serial port, ignoring...", e);
}
}, },
async flashEsp32() { async flashEsp32() {
@@ -884,7 +889,11 @@
// close port // close port
console.log("Closing serial port"); console.log("Closing serial port");
try {
await serialPort.close(); await serialPort.close();
} catch(e) {
console.log("failed to close serial port, ignoring...", e);
}
}, },
async detect() { async detect() {

View File

@@ -135,7 +135,11 @@ class RNode {
} }
async close() { async close() {
try {
await this.serialPort.close(); await this.serialPort.close();
} catch(e) {
console.log("failed to close serial port, ignoring...", e);
}
} }
async write(bytes) { async write(bytes) {