twilio/flask-restful — pull request #296 by diezguerra (2014-09-05 01:12:16+00:00)
Title: error_router falls back on original when it fails

The flask-restful library was original designed to handle all errors that
happen within the domain of its restful endpoints.

This design decision collides with the assumption other library writers make,
trusting the custom error handlers they set up in the base app to kick in when
they throw one of their custom exception.

Given that flask-restful hijacks `app.handle_exception` on initialization,
that assumption of the latter developers causes some libraries to fail.

By making the flask-restful error_router fall back onto the `original_handler`
when the local one can't handle / re-raises the exception, we return the
control to the third-party extension handler for a last attempt at handling.

This is probably the case too for the `app.handle_user_exception` hijacking,
but it wasn't investigated this time around.