mirror of
https://github.com/esphome/esp-web-tools.git
synced 2025-07-25 20:56:43 +00:00
Do not silently ignore errors not caused by user closing picker (#115)
This commit is contained in:
parent
a8dc857f26
commit
ddbe525c99
@ -5,8 +5,11 @@ export const connect = async (button: InstallButton) => {
|
||||
let port: SerialPort | undefined;
|
||||
try {
|
||||
port = await navigator.serial.requestPort();
|
||||
} catch (err) {
|
||||
console.error("User cancelled request", err);
|
||||
} catch (err: any) {
|
||||
if ((err as DOMException).name === "NotFoundError") {
|
||||
return;
|
||||
}
|
||||
alert(`Error: ${err.message}`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user