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
@@ -75,7 +75,7 @@ function* handleConnect(): Generator {
|
||||
}),
|
||||
);
|
||||
} catch (err) {
|
||||
if (err instanceof DOMException && err.code === DOMException.NOT_FOUND_ERR) {
|
||||
if (err instanceof DOMException && err.name === 'NotFoundError') {
|
||||
// this can happen if the use cancels the dialog
|
||||
yield* put(didFailToConnect(Reason.Canceled));
|
||||
} else {
|
||||
@@ -119,7 +119,7 @@ function* handleConnect(): Generator {
|
||||
} catch (err) {
|
||||
server.disconnect();
|
||||
yield* takeMaybe(disconnectChannel);
|
||||
if (err instanceof DOMException && err.code === DOMException.NOT_FOUND_ERR) {
|
||||
if (err instanceof DOMException && err.name === 'NotFoundError') {
|
||||
yield* put(didFailToConnect(Reason.GattServiceNotFound));
|
||||
} else {
|
||||
yield* put(didFailToConnect(Reason.Unknown, ensureError(err)));
|
||||
|
||||
Reference in New Issue
Block a user