Explorar o código

调整异常自定义消息返回

yf_fyh %!s(int64=3) %!d(string=hai) anos
pai
achega
d517d77f7c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      utils/exception.py

+ 1 - 1
utils/exception.py

@@ -12,7 +12,7 @@ def custom_exception_handler(exc, context):
     response = exception_handler(exc, context)
     if response is None:
         return Response({
-            'code': response.status_code,
+            'code': status.HTTP_500_INTERNAL_SERVER_ERROR,
             'msg': 'error:{exc}'.format(exc=exc),
             'data': ''
         }, status=status.HTTP_500_INTERNAL_SERVER_ERROR, exception=True)