def log_error(exception): handler = AirbrakeErrorHandler( api_key=application.config['AIRBRAKE_API_KEY'], api_url=application.config['AIRBRAKE_API_URL'], env_name=application.config['version_hash'], env_variables={'type': 'logged'}, request_url=request.url, request_path=request.path, request_method=request.method, request_args=request.args, request_headers=request.headers) handler.emit(exception)
def log_exception(sender, exception, **extra): if isinstance(exception, (ClientDisconnected, )): return handler = AirbrakeErrorHandler( api_key=application.config['AIRBRAKE_API_KEY'], api_url=application.config['AIRBRAKE_API_URL'], env_name=application.config['version_hash'], env_variables={'type': 'caught'}, request_url=request.url, request_path=request.path, request_method=request.method, request_args=request.args, request_headers=request.headers) handler.emit(exception)