feat: better connection error messages

resolve #159
fixes #158
fixes #153
This commit is contained in:
2025-02-14 16:31:43 +01:00
parent 45c5f21cc4
commit 089812c555
5 changed files with 134 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ import {
stringifyPhrase,
} from "$lib/serial/chord";
import { browser } from "$app/environment";
import { showConnectionFailedDialog } from "$lib/dialogs/connection-failed-dialog";
const PORT_FILTERS: Map<string, SerialPortFilter> = new Map([
["ONE M0", { usbProductId: 32783, usbVendorId: 9114 }],
@@ -142,9 +143,8 @@ export class CharaDevice {
this.chipset = chipset as typeof this.chipset;
this.keyCount = KEY_COUNTS[this.device];
} catch (e) {
alert(e);
console.error(e);
throw e;
await showConnectionFailedDialog(String(e));
}
}