mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-11 17:14:15 +00:00
Add error notification for service error
On Linux/BlueZ, sometimes the services are not enumerated properly and the user has to remove the Bluetooth device from BlueZ, then it should work correctly.
This commit is contained in:
committed by
David Lechner
parent
416c5b16e2
commit
21208344be
@@ -95,6 +95,17 @@ async function connect(action: Action, dispatch: Dispatch): Promise<void> {
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
if (
|
||||
err instanceof DOMException &&
|
||||
err.code === DOMException.NOT_FOUND_ERR
|
||||
) {
|
||||
dispatch(
|
||||
notification.add(
|
||||
'error',
|
||||
'Connected to hub but failed to get LEGO bootloader service. Try removing the "LEGO Bootloader" device in your OS Bluetooth settings, then try again.',
|
||||
),
|
||||
);
|
||||
}
|
||||
device.gatt.disconnect();
|
||||
throw err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user