'Handles an exception raised from mw or a responder.
Args:
ex: Exception to handle
req: Current request object to pass to the handler
registered for the given exception type
resp: Current response object to pass to the handler
registered for the given exception type
params: Responder params to pass to the handler
registered for the given exception type
Returns:
bool: ``True`` if a handler was found and called for the
exception, ``False`` otherwise.'

def _handle_exception(self, ex, req, resp, params):

    for (err_type, err_handler) in self._error_handlers:
        if isinstance(ex, err_type):
            try:
                err_handler(ex, req, resp, params)
            except HTTPStatus as status:
                self._compose_status_response(req, resp, status)
            except HTTPError as error:
                self._compose_error_response(req, resp, error)
            return True
    return False
