@app.errorhandler(http_client.INTERNAL_SERVER_ERROR)
def unexpected_error(e):
 logging.exception('An error occured while processing the request.')
 response = jsonify({'code': http_client.INTERNAL_SERVER_ERROR, 'message': 'Exception: {}'.format(e)})
 response.status_code = http_client.INTERNAL_SERVER_ERROR
 return response

@ app . errorhandler ( http_client . INTERNAL_SERVER_ERROR ) def unexpected_error ( e ) : logging . exception ( 'An error occured while processing the request.' ) response = jsonify ( { 'code' : http_client . INTERNAL_SERVER_ERROR , 'message' : 'Exception: {}' . format ( e ) } ) response . status_code = http_client . INTERNAL_SERVER_ERROR return response
handle exceptions by returning swagger-compliant json .