修复了影响生产环境的问题,在生产环境中成功运行
This commit is contained in:
@@ -67,6 +67,8 @@ def custom_exception_handler(exc, context):
|
||||
f"错误类型: {type(exc).__name__}, 错误: {str(exc)}"
|
||||
)
|
||||
if not settings.DEBUG:
|
||||
import traceback
|
||||
print(traceback.format_exc())
|
||||
return Response(
|
||||
{'code': 500, 'message': '服务器内部错误,请稍后重试'},
|
||||
status=status.HTTP_500_INTERNAL_SERVER_ERROR
|
||||
|
||||
Reference in New Issue
Block a user