Package coprs :: Package rest_api :: Class MyApi
[hide private]
[frames] | no frames]

Class MyApi

source code


Instance Methods [hide private]
 
error_router(self, original_handler, e)
This function decides whether the error occured in a flask-restful endpoint or not.
source code

Inherited from flask_restful.Api: __init__, add_resource, handle_error, init_app, make_response, mediatypes, mediatypes_method, output, owns_endpoint, representation, resource, unauthorized, url_for

Inherited from flask_restful.Api (private): _complete_url, _deferred_blueprint_init, _has_fr_route, _init_app, _register_view, _should_use_fr_error_handler

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]

Inherited from flask_restful.Api (private): _blueprint_setup_add_url_rule_patch

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

error_router(self, original_handler, e)

source code 

This function decides whether the error occured in a flask-restful endpoint or not. If it happened in a flask-restful endpoint, our handler will be dispatched. If it happened in an unrelated view, the app's original error handler will be dispatched. In the event that the error occurred in a flask-restful endpoint but the local handler can't resolve the situation, the router will fall back onto the original_handler as last resort.

:param original_handler: the original Flask error handler for the app :type original_handler: function :param e: the exception raised while handling the request :type e: Exception

Overrides: flask_restful.Api.error_router
(inherited documentation)