From fe2b29da4987caa43386cee18071b6bbd4a5e50f Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Tue, 24 Feb 2026 15:25:11 +0000 Subject: [PATCH] Add some extra returns --- package.json | 2 +- src/blueapi/blueapi.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b1e97c8..6cb8248 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "i24-daq-ui", "private": true, - "version": "0.0.10", + "version": "0.0.11", "type": "module", "scripts": { "dev": "vite", diff --git a/src/blueapi/blueapi.ts b/src/blueapi/blueapi.ts index 9f070da..cd7f242 100644 --- a/src/blueapi/blueapi.ts +++ b/src/blueapi/blueapi.ts @@ -87,7 +87,7 @@ function submitTask(request: BlueApiRequestBody): Promise { `Unable to POST request, response error ${res.status} ${res.statusText}`, ); } - res.json().then((res) => res["task_id"]); + return res.json().then((res) => res["task_id"]); }); } @@ -98,7 +98,7 @@ function runTask(taskId: string): Promise { `Unable to run task, response error ${res.status} ${res.statusText}`, ); } - res.json().then((res) => res["task_id"]); + return res.json().then((res) => res["task_id"]); }); } @@ -108,6 +108,8 @@ export function submitAndRunPlanImmediately( return submitTask(request).then((res) => { if (res) { runTask(res); + } else { + throw new Error("Couldn't run plan"); } }); }