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({
downloadFile(exportData, mimeType, filename);
} catch (e) {
toastMessenger.error('Exporting annotations failed');
toastMessenger.error(`Exporting annotations failed: ${e.message}`, {
autoDismiss: false,
});
}
},
[
......@@ -240,7 +242,9 @@ function ExportAnnotations({
toastMessenger.success('Annotations copied');
} catch (e) {
toastMessenger.error('Copying annotations failed');
toastMessenger.error(`Copying annotations failed: ${e.message}`, {
autoDismiss: false,
});
}
}, [buildExportContent, exportFormat.value, toastMessenger]);
......
......@@ -446,7 +446,8 @@ describe('ExportAnnotations', () => {
assert.calledOnce(fakeAnnotationsExporter.buildJSONExportContent);
assert.calledWith(
fakeToastMessenger.error,
'Exporting annotations failed',
'Exporting annotations failed: Error exporting',
{ autoDismiss: false },
);
});
});
......@@ -512,7 +513,11 @@ describe('ExportAnnotations', () => {
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