Skip to content

Commit

Permalink
Quieten down ADB ENOENT logging
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Dec 19, 2024
1 parent 03a1141 commit 267db19
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/interceptors/android/adb-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@ export function createAdbClient() {

// We listen for errors and report them. This only happens if adbkit completely
// fails to handle or listen to a connection error. We'd rather report that than crash.
client.on('error', logError);
client.on('error', (e) => {
if (isErrorLike(e) && e.code === 'ENOENT') {
// No ADB available - that's fine, not notable at all
return;
}

console.log('ADB client error:', e.message ?? e);
logError(e);
});

return client;
}
Expand Down

0 comments on commit 267db19

Please sign in to comment.