Add the request URL to the reported error info

This commit is contained in:
Joseph Schorr 2014-01-24 20:40:22 -05:00
parent aef719c71a
commit c7e616edb9

View file

@ -21,6 +21,7 @@ def abort(status_code, message=None, **kwargs):
params = dict(request.view_args)
params.update(kwargs)
params['url'] = request.url
params['status_code'] = status_code
params['message'] = message
@ -36,7 +37,7 @@ def abort(status_code, message=None, **kwargs):
auth_token.friendly_name or auth_token.code)
# Log the abort.
logger.error('Error %s: %s. Arguments: %s' % (status_code, message, params))
logger.error('Error %s: %s; Arguments: %s' % (status_code, message, params))
resp = jsonify({'error': message})
resp.status_code = status_code