From 68d43c649d5b04592f94f5edb2ffa861b430a060 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20G=C3=B6bel?= <dgoebel@techfak.uni-bielefeld.de>
Date: Tue, 12 Mar 2024 11:48:40 +0100
Subject: [PATCH] Show raw error message when unsuccessfully staring a workflow
 execution

#106
---
 src/views/workflows/StartWorkflowView.vue | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/views/workflows/StartWorkflowView.vue b/src/views/workflows/StartWorkflowView.vue
index e6fde26..006784f 100644
--- a/src/views/workflows/StartWorkflowView.vue
+++ b/src/views/workflows/StartWorkflowView.vue
@@ -31,11 +31,13 @@ const versionState = reactive<{
   workflowVersion?: WorkflowVersion;
   loading: boolean;
   workflowExecutionError?: string;
+  errorText: string;
 }>({
   parameterSchema: undefined,
   workflowVersion: undefined,
   loading: false,
   workflowExecutionError: undefined,
+  errorText: "",
 });
 
 watch(
@@ -94,9 +96,7 @@ function startWorkflow(
       })
       .catch((err: ApiError) => {
         console.error(err);
-        if (err.body["detail"].includes("workflow execution limit")) {
-          versionState.workflowExecutionError = "limit";
-        }
+        versionState.errorText = err.body["detail"] ?? "";
         errorToast?.show();
       })
       .finally(() => {
@@ -118,13 +118,8 @@ onMounted(() => {
   >
     <template #default>Error starting workflow</template>
     <template #body>
-      <template v-if="versionState.workflowExecutionError === 'limit'">
-        You have too many active workflow executions to start a new one.
-      </template>
-      <template v-else>
-        There was an error with starting the workflow execution. Look in the
-        console for more information.
-      </template>
+      There was an error with starting the workflow execution:<br />
+      "{{ versionState.errorText }}"
     </template>
   </bootstrap-toast>
   <parameter-schema-form-component
-- 
GitLab