Skip to content

Commit

Permalink
Print error message string
Browse files Browse the repository at this point in the history
If the API call results in an error response, we parse the response body and get a string.
However if the fetch call fails for some reason, we get an Error object and putting that directly in the page causes an error.
  • Loading branch information
MonkeyDo committed May 22, 2024
1 parent 0bc0bc6 commit b356fb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/js/src/settings/export/ExportButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function ExportButtons({ listens = true, feedback = true }) {
try {
await downloadFile(window.location.href);
} catch (error) {
setErrorMessage(error);
setErrorMessage(error.toString());
toast.error(
<ToastMsg
title="Error"
Expand All @@ -55,7 +55,7 @@ export default function ExportButtons({ listens = true, feedback = true }) {
try {
await downloadFile("/settings/export-feedback/");
} catch (error) {
setErrorMessage(error);
setErrorMessage(error.toString());
toast.error(
<ToastMsg
title="Error"
Expand Down

0 comments on commit b356fb3

Please sign in to comment.