private void handleError(Throwable error, final Req req, final Resp resp, final ProxyMapping mapping, final int attempts, final long since) {
if (error instanceof ConnectException || error instanceof IOException) {
if (HttpUtils.isGetReq(req) && !U.timedOut(since, timeout())) {
Jobs.after(retryDelay()).milliseconds(() -> process(req, resp, mapping, attempts + 1, since));
} else {
HttpIO.INSTANCE.errorAndDone(req, U.rte("Couldn't connect to the upstream!", error), LogLevel.DEBUG);
}
} else {
HttpIO.INSTANCE.errorAndDone(req, error, LogLevel.ERROR);
}
}