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"