Commit 6191b3fe authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Include extra toast message info when exporting annotations fails

parent 33cb5da1
...@@ -216,7 +216,9 @@ function ExportAnnotations({ ...@@ -216,7 +216,9 @@ function ExportAnnotations({
downloadFile(exportData, mimeType, filename); downloadFile(exportData, mimeType, filename);
} catch (e) { } catch (e) {
toastMessenger.error('Exporting annotations failed'); toastMessenger.error(`Exporting annotations failed: ${e.message}`, {
autoDismiss: false,
});
} }
}, },
[ [
...@@ -240,7 +242,9 @@ function ExportAnnotations({ ...@@ -240,7 +242,9 @@ function ExportAnnotations({
toastMessenger.success('Annotations copied'); toastMessenger.success('Annotations copied');
} catch (e) { } catch (e) {
toastMessenger.error('Copying annotations failed'); toastMessenger.error(`Copying annotations failed: ${e.message}`, {
autoDismiss: false,
});
} }
}, [buildExportContent, exportFormat.value, toastMessenger]); }, [buildExportContent, exportFormat.value, toastMessenger]);
......
...@@ -446,7 +446,8 @@ describe('ExportAnnotations', () => { ...@@ -446,7 +446,8 @@ describe('ExportAnnotations', () => {
assert.calledOnce(fakeAnnotationsExporter.buildJSONExportContent); assert.calledOnce(fakeAnnotationsExporter.buildJSONExportContent);
assert.calledWith( assert.calledWith(
fakeToastMessenger.error, fakeToastMessenger.error,
'Exporting annotations failed', 'Exporting annotations failed: Error exporting',
{ autoDismiss: false },
); );
}); });
}); });
...@@ -512,7 +513,11 @@ describe('ExportAnnotations', () => { ...@@ -512,7 +513,11 @@ describe('ExportAnnotations', () => {
copyButton.simulate('click'); copyButton.simulate('click');
}); });
assert.calledWith(fakeToastMessenger.error, 'Copying annotations failed'); assert.calledWith(
fakeToastMessenger.error,
'Copying annotations failed: Something failed',
{ autoDismiss: false },
);
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment