|
|
@ -15,7 +15,7 @@ def exception_handler(exc, context):
|
|
|
|
if response is None:
|
|
|
|
if response is None:
|
|
|
|
# print(exc) # 错误原因
|
|
|
|
# print(exc) # 错误原因
|
|
|
|
# print(context) # 错误信息
|
|
|
|
# print(context) # 错误信息
|
|
|
|
print('%s - %s - %s' % (context['view'], context['request'].method, exc))
|
|
|
|
# print('%s - %s - %s' % (context['view'], context['request'].method, exc))
|
|
|
|
return Response({
|
|
|
|
return Response({
|
|
|
|
'detail': '服务器错误'
|
|
|
|
'detail': '服务器错误'
|
|
|
|
}, status=status.HTTP_500_INTERNAL_SERVER_ERROR, exception=True)
|
|
|
|
}, status=status.HTTP_500_INTERNAL_SERVER_ERROR, exception=True)
|
|
|
|