Properly handle paste exceptions
With Python 3, it doesn't work to decode type str. The str() recast is still necessary however, since the exception data type is not directly serializable in this way. Change-Id: I3925cbb0d0ff594407c7b93b0d982f2cad386ad6
This commit is contained in:
parent
8057480ced
commit
197a98a120
@ -42,6 +42,6 @@ class JSONRequestHandler(object):
|
||||
'error': None
|
||||
}
|
||||
except Exception as e:
|
||||
response = {'data': None, 'error': str(e).decode('utf-8')}
|
||||
response = {'data': None, 'error': str(e)}
|
||||
body = dumps(response, indent=local.request.is_xhr and 2 or 0)
|
||||
return Response(body + '\n', mimetype='application/json')
|
||||
|
Loading…
x
Reference in New Issue
Block a user