Skip to content

Commit

Permalink
Show errors on upload
Browse files Browse the repository at this point in the history
  • Loading branch information
rien committed Jul 5, 2023
1 parent 4ca12f2 commit d1b8af5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions web/src/components/upload/UploadFormCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const step = shallowRef(1);
const valid = shallowRef(false);
// Error message, in case of an error.
const error = shallowRef();
const stderr = shallowRef();
// Selected file.
const file = shallowRef<File>();
Expand Down Expand Up @@ -247,8 +248,9 @@ const startPolling = (reportId: string): void => {
clearForm();
}
if (report.status === "error" || report.status === "failed") {
handleError(status.error);
if (report.status === "failed" || report.status === "error") {
stderr.value = status.stderr.split("\n")[0].replace(/\[\d+m/g, "");
handleError(`An error occurred while analyzing the dataset (${status.error})`);
}
}
} catch (e: any) {
Expand Down Expand Up @@ -294,7 +296,8 @@ watch(
<v-stepper-content step="1">
<transition name="slide-y-transition">
<v-alert v-if="error" text type="error">
{{ error }}
{{ error }}<br />
{{ stderr }}
</v-alert>
</transition>

Expand Down Expand Up @@ -460,4 +463,5 @@ watch(
width: 100%;
}
}
</style>

0 comments on commit d1b8af5

Please sign in to comment.