diff --git a/src/components/API/Experiment.tsx b/src/components/API/Experiment.tsx index 567221d0..7fd6585c 100644 --- a/src/components/API/Experiment.tsx +++ b/src/components/API/Experiment.tsx @@ -200,11 +200,12 @@ class Experiment extends Container { ...experiment, status: 'error', result: [ - { - type: MIME_TYPES.ERROR, - data: 'An unknown error occured. Please retry in a moment' - }, - ...(experiment?.result || []) + ...(experiment?.result ?? [ + { + type: MIME_TYPES.ERROR, + data: 'An unknown error occured. Please retry in a moment' + } + ]) ] }; } diff --git a/src/components/API/Mining.tsx b/src/components/API/Mining.tsx index d0dedbc9..cb671a29 100644 --- a/src/components/API/Mining.tsx +++ b/src/components/API/Mining.tsx @@ -231,7 +231,9 @@ class Mining extends Container { return this.setState({ histograms: { data: undefined, - error: response.data.message, + error: + response.data.message ?? + (mining.result ? mining.result[0].data : 'unknown error occured'), loading: false } });