|
|
@@ -126,13 +126,10 @@ def json_error_page(status, message, traceback, version, |
|
|
|
"message" : message, |
|
|
|
"traceback" : traceback } |
|
|
|
# Don't send a traceback if the error was 400-499 (client's fault) |
|
|
|
try: |
|
|
|
code = int(status.split()[0]) |
|
|
|
if not force_traceback: |
|
|
|
if code >= 400 and code <= 499: |
|
|
|
errordata["traceback"] = "" |
|
|
|
except Exception: # pragma: no cover |
|
|
|
pass |
|
|
|
code = int(status.split()[0]) |
|
|
|
if not force_traceback: |
|
|
|
if code >= 400 and code <= 499: |
|
|
|
errordata["traceback"] = "" |
|
|
|
# Override the response type, which was previously set to text/html |
|
|
|
cherrypy.serving.response.headers['Content-Type'] = ( |
|
|
|
"application/json;charset=utf-8" ) |
|
|
|