flask.Request.routing_exception

Request.routing_exception = None

If matching the URL failed, this is the exception that will be raised / was raised as part of the request handling. This is usually a NotFound exception or something similar.