From b947a3d0cbc5d115d7a5fe5e1079ed2d4dc1f480 Mon Sep 17 00:00:00 2001 From: Federico Stagni Date: Tue, 23 Apr 2024 09:48:20 +0200 Subject: [PATCH] sweep: #761 fix: do not display the exception in the web browser --- src/WebAppDIRAC/Lib/WebHandler.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/WebAppDIRAC/Lib/WebHandler.py b/src/WebAppDIRAC/Lib/WebHandler.py index 02a5a877..40367bc2 100644 --- a/src/WebAppDIRAC/Lib/WebHandler.py +++ b/src/WebAppDIRAC/Lib/WebHandler.py @@ -305,11 +305,8 @@ def write_error(self, status_code, **kwargs): if "exc_info" in kwargs: ex = kwargs["exc_info"][1] trace = traceback.format_exception(*kwargs["exc_info"]) - if not isinstance(ex, WErr): - data += "\n".join(trace) - else: - if self.settings.get("debug"): - self.log.error("Request ended in error:\n %s" % "\n ".join(trace)) + self.log.error("Request ended in error:\n %s" % "\n ".join(trace)) + if isinstance(ex, WErr): data = ex.msg if isinstance(data, dict): cType = "application/json"