mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-14 10:35:11 +00:00
remove use of deprecated DomException code property
This commit is contained in:
committed by
David Lechner
parent
eb26bfcf1b
commit
db43cb3e99
@@ -638,10 +638,7 @@ function* handleFlashUsbDfu(action: ReturnType<typeof firmwareFlashUsbDfu>): Gen
|
||||
],
|
||||
})
|
||||
.catch((err) => {
|
||||
if (
|
||||
err instanceof DOMException &&
|
||||
err.code === DOMException.NOT_FOUND_ERR
|
||||
) {
|
||||
if (err instanceof DOMException && err.name === 'NotFoundError') {
|
||||
// user clicked cancel button
|
||||
return undefined;
|
||||
}
|
||||
@@ -685,10 +682,7 @@ function* handleFlashUsbDfu(action: ReturnType<typeof firmwareFlashUsbDfu>): Gen
|
||||
|
||||
defer.push(() =>
|
||||
dfu.close().catch((err) => {
|
||||
if (
|
||||
err instanceof DOMException &&
|
||||
err.code === DOMException.NETWORK_ERR
|
||||
) {
|
||||
if (err instanceof DOMException && err.name === 'NetworkError') {
|
||||
// device was disconnected
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user