Show alert when opening serial port fails (#123)

This commit is contained in:
Bram Kragten 2021-11-15 22:41:18 +01:00 committed by GitHub
parent 91169c1dfa
commit f3cb744b4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,12 @@ export const connect = async (button: InstallButton) => {
return; return;
} }
await port.open({ baudRate: 115200 }); try {
await port.open({ baudRate: 115200 });
} catch (err: any) {
alert(err.message);
return;
}
const el = document.createElement("ewt-install-dialog"); const el = document.createElement("ewt-install-dialog");
el.port = port; el.port = port;