From 5001a35aa9400dce26282400918496fa4d47c7e3 Mon Sep 17 00:00:00 2001 From: adkinsrs Date: Wed, 11 Sep 2024 08:40:10 -0400 Subject: [PATCH] more error handling --- www/js/classes/analysis.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/www/js/classes/analysis.js b/www/js/classes/analysis.js index f5773ae4..df8e10d1 100644 --- a/www/js/classes/analysis.js +++ b/www/js/classes/analysis.js @@ -372,6 +372,10 @@ class Analysis { dataset_id: this.dataset.id })); + if (data.error) { + throw new Error(data.error); + } + // Load the analysis data and assign it to the current instance const ana = await Analysis.loadFromJson(data, datasetObj); Object.assign(this, ana); @@ -389,7 +393,7 @@ class Analysis { } catch (error) { logErrorInConsole(`Failed ID was: ${datasetId} because msg: ${error}`); - createToast(`Error getting stored analysis`); + createToast(`Error retrieving stored analysis`); } // Restore the dataset object