private boolean canRetry(UpstreamRoute route) {
        try {
            route.next();
        } catch (HttpException e) {
            respond(e);
            return false;
        }
        return true;
    }
Called when proxy received the response headers from the origin.
server/src/main/java/com/epam/aidial/core/server/controller/RouteController.java