From 7940a09f178173c4fcb4fdf18835aa78fdd8cd22 Mon Sep 17 00:00:00 2001 From: kunliangwu Date: Thu, 24 Feb 2022 20:00:58 +0800 Subject: [PATCH] fix(logging/exception): remove redundant logging while handle the exceptions --- src/api/bkuser_core/common/exception_handler.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/api/bkuser_core/common/exception_handler.py b/src/api/bkuser_core/common/exception_handler.py index dcfc78bde..6fe1ad7e4 100644 --- a/src/api/bkuser_core/common/exception_handler.py +++ b/src/api/bkuser_core/common/exception_handler.py @@ -68,7 +68,7 @@ def get_ee_exception_response(exc, context): elif isinstance(exc, AuthenticationFailed): data["message"] = "403, authentication failed" else: - logger.exception("request apiServer failed") + logger.exception("unknown exception while handling the request") data["message"] = UNKNOWN_ERROR_HINT data["code"] = -1 @@ -79,7 +79,6 @@ def get_ee_exception_response(exc, context): setattr(response, "from_exception", True) return response - logger.exception("request apiServer failed") response = Response(data=data, status=EE_GENERAL_STATUS_CODE) setattr(response, "from_exception", True) return response