use of org.webpieces.router.impl.model.MatchResult in project webpieces by deanhiller.
the class RouteInvoker method internalServerError.
private CompletableFuture<Void> internalServerError(ErrorRoutes errorRoutes, Throwable exc, RequestContext requestCtx, ResponseStreamer responseCb, Object failedRoute) {
try {
log.error("There is three parts to this error message... request, route found, and the exception " + "message. You should\nread the exception message below as well as the RouterRequest and RouteMeta.\n\n" + requestCtx.getRequest() + "\n\n" + failedRoute + ". \n\nNext, server will try to render apps 5xx page\n\n", exc);
SupressedExceptionLog.log(exc);
RouteMeta meta = errorRoutes.fetchInternalServerErrorRoute();
MatchResult res = new MatchResult(meta);
return invokeImpl(res, meta.getService222(), requestCtx, responseCb);
} catch (Throwable e) {
//http 500...
//return a completed future with the exception inside...
CompletableFuture<Void> futExc = new CompletableFuture<Void>();
futExc.completeExceptionally(e);
return futExc;
}
}
Aggregations