Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
fix(ScannerModal): hide nasty API errors from user (#438)
Browse files Browse the repository at this point in the history
* fix(ScannerModal): hide nasty API errors from user

* refactor(scanner): nit

---------

Co-authored-by: Lars Mitsem Selbekk <[email protected]>
  • Loading branch information
AdrianAndersen and LarsSelbekk authored Jun 18, 2024
1 parent da2fb5a commit ad30e74
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/matches/Scanner/ScannerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ const ScannerModal = ({
severity: feedback ? "info" : "success",
visible: true,
});
handleItemTransferred?.();
try {
handleItemTransferred?.();
} catch (error: unknown) {
// Do not expose potentially rough API errors to user
console.error("Got error when handling item transferred", error);
}
} catch (error) {
setFeedback({
text: String(error),
Expand Down

0 comments on commit ad30e74

Please sign in to comment.