Skip to content

Commit

Permalink
more error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
adkinsrs committed Sep 11, 2024
1 parent 73951d1 commit 5001a35
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion www/js/classes/analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit 5001a35

Please sign in to comment.