diff --git a/webapp/src/components/labThingsComponents/actionButton.vue b/webapp/src/components/labThingsComponents/actionButton.vue index 00346a75..7b49e347 100644 --- a/webapp/src/components/labThingsComponents/actionButton.vue +++ b/webapp/src/components/labThingsComponents/actionButton.vue @@ -251,7 +251,7 @@ export default { this.modalNotify(`The action '${this.submitLabel}' was cancelled.`); } } catch (error) { - this.$emit("error", error | Error("Unknown error")); + this.$emit("error", error); } finally { // Reset taskRunning and taskId this.taskRunning = false; @@ -297,7 +297,9 @@ export default { else if (result == "error") { // Pass the error string back with reject if (!this.progress) this.progress = 1; - reject(new Error(response.data.output)); + // Assume that the most recent message in the log is the error message + // and raise an Error with that message + reject(new Error(response.data.log.at(-1).message)); } // If task ends without reporting an error // (NB this includes cancellation)