From c1be00e79a191faefbfa9435bb3508af6b5b2a95 Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Tue, 9 Jan 2024 19:01:29 +0100 Subject: [PATCH] chore: improve debugging experience (#3944) --- framework/core/js/src/common/Application.tsx | 4 +++- .../js/src/common/components/RequestErrorModal.tsx | 13 +++++++++++++ framework/core/less/common/scaffolding.less | 6 ++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/framework/core/js/src/common/Application.tsx b/framework/core/js/src/common/Application.tsx index bccc69b18..606b6e2b4 100644 --- a/framework/core/js/src/common/Application.tsx +++ b/framework/core/js/src/common/Application.tsx @@ -604,7 +604,9 @@ export default class Application { console.groupEnd(); } - if (e.alert) { + if (e.status === 500 && isDebug) { + app.modal.show(RequestErrorModal, { error: e, formattedError: formattedErrors }); + } else if (e.alert) { this.requestErrorAlert = this.alerts.show(e.alert, e.alert.content); } } else { diff --git a/framework/core/js/src/common/components/RequestErrorModal.tsx b/framework/core/js/src/common/components/RequestErrorModal.tsx index b537993dd..b1ee48689 100644 --- a/framework/core/js/src/common/components/RequestErrorModal.tsx +++ b/framework/core/js/src/common/components/RequestErrorModal.tsx @@ -30,6 +30,19 @@ export default class RequestErrorModal Sfdump = window.Sfdump')) { + responseText = ( +