Skip to content

Commit

Permalink
ignore errors closing serial port
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcottle committed Oct 6, 2024
1 parent 226936a commit a89ded6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
13 changes: 11 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,12 @@

// close port
console.log("Closing serial port");
await this.serialPort.close();
try {
await this.serialPort.close();
} catch(e) {
console.log("failed to close serial port, ignoring...", e);
}


},
async flashEsp32() {
Expand Down Expand Up @@ -884,7 +889,11 @@

// close port
console.log("Closing serial port");
await serialPort.close();
try {
await serialPort.close();
} catch(e) {
console.log("failed to close serial port, ignoring...", e);
}

},
async detect() {
Expand Down
6 changes: 5 additions & 1 deletion js/rnode.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ class RNode {
}

async close() {
await this.serialPort.close();
try {
await this.serialPort.close();
} catch(e) {
console.log("failed to close serial port, ignoring...", e);
}
}

async write(bytes) {
Expand Down

0 comments on commit a89ded6

Please sign in to comment.