diff --git a/client/src/components/Draftail/EditorFallback/EditorFallback.js b/client/src/components/Draftail/EditorFallback/EditorFallback.js index 26f0b4aa13..f982e4f2d0 100644 --- a/client/src/components/Draftail/EditorFallback/EditorFallback.js +++ b/client/src/components/Draftail/EditorFallback/EditorFallback.js @@ -83,7 +83,7 @@ class EditorFallback extends PureComponent { className="Draftail-ToolbarButton" onClick={this.toggleError} > - {'Show error'} + {STRINGS.SHOW_ERROR} {/* At first we propose reloading the editor. If it still crashes, reload the whole page. */} @@ -122,7 +122,7 @@ class EditorFallback extends PureComponent { {showError && (
- {`${error.stack}\n${info.componentStack}`}
+ {`${error.name}: ${error.message}\n\n${error.stack}\n${info.componentStack}`}
)}
diff --git a/client/src/components/Draftail/EditorFallback/__snapshots__/EditorFallback.test.js.snap b/client/src/components/Draftail/EditorFallback/__snapshots__/EditorFallback.test.js.snap
index 724982f154..2308c018a0 100644
--- a/client/src/components/Draftail/EditorFallback/__snapshots__/EditorFallback.test.js.snap
+++ b/client/src/components/Draftail/EditorFallback/__snapshots__/EditorFallback.test.js.snap
@@ -88,7 +88,9 @@ exports[`EditorFallback #error #showError 1`] = `
- test stack
+ Error: test
+
+test stack
test
diff --git a/client/tests/stubs.js b/client/tests/stubs.js
index afdeb565dc..3506d35b56 100644
--- a/client/tests/stubs.js
+++ b/client/tests/stubs.js
@@ -39,6 +39,7 @@ global.wagtailConfig = {
RELOAD_PAGE: 'Reload the page',
RELOAD_EDITOR: 'Reload saved content',
SHOW_LATEST_CONTENT: 'Show latest content',
+ SHOW_ERROR: 'Show error',
EDITOR_CRASH: 'The editor just crashed. Content has been reset to the last saved version.',
},
};
diff --git a/wagtail/admin/templates/wagtailadmin/admin_base.html b/wagtail/admin/templates/wagtailadmin/admin_base.html
index f5ff95e80f..22d3c979bd 100644
--- a/wagtail/admin/templates/wagtailadmin/admin_base.html
+++ b/wagtail/admin/templates/wagtailadmin/admin_base.html
@@ -47,6 +47,7 @@
RELOAD_PAGE: "{% trans 'Reload the page' %}",
RELOAD_EDITOR: "{% trans 'Reload saved content' %}",
SHOW_LATEST_CONTENT: "{% trans 'Show latest content' %}",
+ SHOW_ERROR: "{% trans 'Show error' %}",
EDITOR_CRASH: "{% trans 'The editor just crashed. Content has been reset to the last saved version.' %}",
};