Skip to content

Commit

Permalink
add error handling for failure to open device
Browse files Browse the repository at this point in the history
  • Loading branch information
noahm committed Jan 12, 2025
1 parent 05f6f48 commit 901f8c2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ui/pad-coms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ export async function promptSelectDevice() {

export async function open_smx_device(dev: HIDDevice, autoSelect = false) {
if (!dev.opened) {
await dev.open();
try {
await dev.open();
} catch (e) {
console.error(e);
uiState.set(nextStatusTextLine$, "failed to open device; more details in the browser console.");
uiState.set(nextStatusTextLine$, "if you are using linux, permissions to talk to a stage are still an unsolved puzzle.");
return;
}
}

const stage = new SMXStage(dev);
Expand Down

0 comments on commit 901f8c2

Please sign in to comment.