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 {
7171 * @param port The port to connect to.
7272 */
7373 public async openSerialPort ( port : string ) : Promise < void > {
74- if ( this . serialPort ?. path === port ) {
74+ if ( this . serialPort ?. path === port && this . serialPort . isOpen ) {
7575 return ;
7676 }
7777
Original file line number Diff line number Diff line change @@ -1418,7 +1418,17 @@ export async function runFile(
14181418 }
14191419
14201420 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+
14221432 return false ;
14231433 } finally {
14241434 await fileHandle ?. close ( ) ;
@@ -1478,7 +1488,17 @@ export async function runRemoteFile(
14781488 }
14791489
14801490 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+
14821502 return false ;
14831503 }
14841504}
You can’t perform that action at this time.
0 commit comments