code: def json_error(code, message):
      
      # Message can be an unserializable object.
      message = repr(message)
      return jsonify(dict(request=request.path, message=message)), code
docs: Returns a JSON-ified error object