Fix traceback not being shown on general exceptions
This commit is contained in:
parent
13040d559b
commit
fc5c33c918
1 changed files with 6 additions and 4 deletions
|
@ -4,6 +4,7 @@ import json
|
||||||
import mimetypes
|
import mimetypes
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
|
import traceback
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import warnings
|
import warnings
|
||||||
import zipstream
|
import zipstream
|
||||||
|
@ -91,10 +92,11 @@ def P_wrapper(function):
|
||||||
flask.abort(response)
|
flask.abort(response)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if response_type == 'html':
|
traceback.print_exc()
|
||||||
flask.abort(500)
|
if response_type == 'html':
|
||||||
else:
|
flask.abort(500)
|
||||||
flask.abort(jsonify.make_response({}, status=500))
|
else:
|
||||||
|
flask.abort(jsonify.make_response({}, status=500))
|
||||||
|
|
||||||
return P_wrapped
|
return P_wrapped
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue