allRequestsMeter.mark();
try {
Result result = route.getFilterChain().next(context);
resultHandler.handleResult(result, context);
} catch (Exception exception) {
if (exception instanceof BadRequestException) {
badRequests.mark();
} else {
internalServerErrors.mark();
}
Result result = onException(context, exception);
renderErrorResultAndCatchAndLogExceptions(result, context);
}
} else {
// throw a 404 "not found" because we did not find the route
routesNotFound.mark();
Result result = getNotFoundResult(context);
renderErrorResultAndCatchAndLogExceptions(result, context);
}
activeRequests.dec();
}