Skip to content

Commit

Permalink
fix: 修改日志打印问题 #7626
Browse files Browse the repository at this point in the history
  • Loading branch information
guohelu committed Dec 17, 2024
1 parent 1a2d30d commit ac035af
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gcloud/contrib/template_market/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
}
)
Expand Down

0 comments on commit ac035af

Please sign in to comment.