File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export class PicoMpyCom extends EventEmitter {
71
71
* @param port The port to connect to.
72
72
*/
73
73
public async openSerialPort ( port : string ) : Promise < void > {
74
- if ( this . serialPort ?. path === port ) {
74
+ if ( this . serialPort ?. path === port && this . serialPort . isOpen ) {
75
75
return ;
76
76
}
77
77
Original file line number Diff line number Diff line change @@ -1418,7 +1418,17 @@ export async function runFile(
1418
1418
}
1419
1419
1420
1420
return true ;
1421
- } catch {
1421
+ } catch ( error ) {
1422
+ receiver (
1423
+ Buffer . from (
1424
+ error instanceof Error
1425
+ ? error . message
1426
+ : typeof error === "string"
1427
+ ? error
1428
+ : "Unknown error"
1429
+ )
1430
+ ) ;
1431
+
1422
1432
return false ;
1423
1433
} finally {
1424
1434
await fileHandle ?. close ( ) ;
@@ -1478,7 +1488,17 @@ export async function runRemoteFile(
1478
1488
}
1479
1489
1480
1490
return true ;
1481
- } catch {
1491
+ } catch ( error ) {
1492
+ receiver (
1493
+ Buffer . from (
1494
+ error instanceof Error
1495
+ ? error . message
1496
+ : typeof error === "string"
1497
+ ? error
1498
+ : "Unknown error"
1499
+ )
1500
+ ) ;
1501
+
1482
1502
return false ;
1483
1503
}
1484
1504
}
You can’t perform that action at this time.
0 commit comments