Post-processing of the response (after routing).

        Some fundamental errors can't be intercepted any other
        way in Falcon. These include 404 when the route isn't found
        & 405 when the method is bunk. Falcon will try to send its
        own errors.

        In these cases, intercept them & replace them with our
        JSON API compliant version.

        TIP: If no route could be determined then the resource
             will be None.

def process_response(self, req, resp, resource):
        """ Post-processing of the response (after routing).

        Some fundamental errors can't be intercepted any other
        way in Falcon. These include 404 when the route isn't found
        & 405 when the method is bunk. Falcon will try to send its
        own errors.

        In these cases, intercept them & replace them with our
        JSON API compliant version.

        TIP: If no route could be determined then the resource
             will be None.
        """

        if not resource and resp.status == falcon.HTTP_404:
            abort(exceptions.RouteNotFound)
        elif resp.status == falcon.HTTP_405:
            abort(exceptions.MethodNotAllowed)