Skip to content

Commit

Permalink
[menu-bar] Improve feedback to the user when an error occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldonadel committed Sep 15, 2023
1 parent 929fd67 commit df8eabe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion apps/cli/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ export function returnLoggerMiddleware(
console.log(result);
} catch (error) {
console.log("---- thrown error ----");
console.log(error);
if (error instanceof Error) {
console.log(error.message);
} else {
console.log(error);
}
}
};
}
Expand Down
4 changes: 3 additions & 1 deletion apps/menu-bar/src/popover/Core.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ function Core(props: Props) {
const deviceId = getDeviceId(device);
await installAndLaunchAppAsync({ appPath: localFilePath, deviceId });
} catch (error) {
console.log(`error ${error}`);
if (error instanceof Error) {
Alert.alert('Something went wrong while installing the app.', error.message);
}
} finally {
setTimeout(() => {
setStatus(Status.LISTENING);
Expand Down

0 comments on commit df8eabe

Please sign in to comment.