From a715b3b1233fd3c1afa6b109c07efcef95e2cb47 Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Wed, 13 Dec 2023 18:16:34 +0100 Subject: [PATCH] chore: improve debugging experience --- 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 bccc69b183..606b6e2b47 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 b537993dd2..b1ee48689c 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 = ( +