Skip to content

Commit aadb1f1

Browse files
vzaidmanfacebook-github-bot
authored andcommitted
improve error reporting when a debugger for an unknown device is opened (#50330)
Summary: Pull Request resolved: #50330 Changelog: [Internal] Make the error reported when a debugger is created for a device that does not exist generic, and not including any specific details to make them easier to aggregate Reviewed By: hoxyq Differential Revision: D71979796 fbshipit-source-id: 88badc51043e35ff91d7db81c5966ed5ffce9109
1 parent 44810f7 commit aadb1f1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/dev-middleware/src/inspector-proxy/InspectorProxy.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,9 @@ export default class InspectorProxy implements InspectorProxyQueries {
520520
}
521521

522522
if (device == null) {
523-
throw new Error('Unknown device with ID ' + deviceId);
523+
throw new Error(
524+
'Debugger connection attempted for a non registered device',
525+
);
524526
}
525527

526528
this.#logger?.info(
@@ -616,9 +618,10 @@ export default class InspectorProxy implements InspectorProxyQueries {
616618
});
617619
} catch (error) {
618620
this.#logger?.error(
619-
"Connection failed to be established with DevTools for app='%s' on device='%s' with error:",
621+
"Connection failed to be established with DevTools for app='%s' on device='%s' and device id='%s' with error:",
620622
device?.getApp() || 'unknown',
621623
device?.getName() || 'unknown',
624+
deviceId,
622625
error,
623626
);
624627
socket.close(INTERNAL_ERROR_CODE, error?.toString() ?? 'Unknown error');

0 commit comments

Comments
 (0)