From ac035af9ab964a27f86499400fddc84f9d42af9c Mon Sep 17 00:00:00 2001 From: guohelu <19503896967@163.com> Date: Tue, 17 Dec 2024 20:27:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E9=97=AE=E9=A2=98=20#7626?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gcloud/contrib/template_market/viewsets.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcloud/contrib/template_market/viewsets.py b/gcloud/contrib/template_market/viewsets.py index 2cdcdfc04..f2094cdc8 100644 --- a/gcloud/contrib/template_market/viewsets.py +++ b/gcloud/contrib/template_market/viewsets.py @@ -32,6 +32,8 @@ from gcloud.contrib.template_market.clients import MarketAPIClient from gcloud.contrib.template_market.permission import TemplatePreviewPermission, SharedTemplateRecordPermission +logger = logging.getLogger("root") + class TemplatePreviewAPIView(APIView): queryset = TaskTemplate.objects.filter(pipeline_template__isnull=False, is_deleted=False) @@ -69,11 +71,12 @@ def _build_template_data(self, serializer, **kwargs): def _handle_response(self, response_data, error_message): if not response_data.get("result"): - logging.exception(error_message) + message = "market template {}, error message: {}".format(error_message, response_data["message"]) + logger.error(message) return Response( { "result": False, - "message": error_message, + "message": message, "code": err_code.OPERATION_FAIL.code, } )