Skip to content

Commit 3803ad6

Browse files
dbg
1 parent 9d11422 commit 3803ad6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

kernel/src/services/DeviceService.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@ export class DeviceService {
2424
}
2525

2626
// Try opening and closing the port to check if it's available
27+
console.log('[checkPort]: Checking if port is available');
2728
try {
2829
await this.port.open({ baudRate: 115200 });
2930
await this.port.close();
3031
}
3132
catch (err) {
32-
if (err instanceof DOMException && err.name === 'InvalidStateError') {
33-
console.log('[checkPort]: Port is already open by another application');
34-
return false;
35-
}
33+
console.log('[checkPort]: Port is already open by another application');
34+
return false;
3635
}
3736

3837
// If we reach here, the port is available

0 commit comments

Comments
 (0)