use of org.webpieces.router.api.dto.RouteType in project webpieces by deanhiller.
the class RouteInvoker method invoke2.
public CompletableFuture<Void> invoke2(MatchResult result, RequestContext requestCtx, ResponseStreamer responseCb, ErrorRoutes errorRoutes) {
//This makes us consistent with other NotFoundExceptions and without the cost of
//throwing an exception and filling in stack trace...
//We could convert the exc. to FastException and override method so stack is not filled in but that
//can get very annoying
RouteMeta meta = result.getMeta();
Route route = meta.getRoute();
RouteType routeType = route.getRouteType();
if (routeType == RouteType.NOT_FOUND) {
CompletableFuture<Void> future = new CompletableFuture<Void>();
future.completeExceptionally(new NotFoundException("route not found"));
return future;
}
return invokeImpl(result, meta.getService222(), requestCtx, responseCb);
}
Aggregations