logger.debug("Tunnel error - [" + hsce.getStatusCode().value() + "] " + hsce.getStatusText());
}
}
else {
logger.warn("Received HTTP Error: [" + hsce.getStatusCode().value() + "] " + hsce.getStatusText());
throw new TunnelException("Error while reading from tunnel", hsce);
}
} catch (SocketTimeoutException e) {
retry = true;
if (logger.isTraceEnabled()) {
logger.trace("Retrying tunnel read after receiving " + e.getClass().getName() + ": " + e.getMessage());
}
} catch (ResourceAccessException e) {
Throwable t = e.getCause();
if (t != null && t instanceof SocketTimeoutException) {
retry = true;
if (logger.isTraceEnabled()) {
logger.trace("Retrying tunnel read after receiving " + e.getClass().getName() + ": " + e.getMessage());
}
} else {
logger.error("Caught exception: " + e.getClass().getName() + ": " + e.getMessage());
logger.error("Closing tunnel " + this);
stop();
throw e;
}
} catch (RuntimeException e) {
logger.error("Caught exception: " + e.getClass().getName() + ": " + e.getMessage());
logger.error("Closing tunnel " + this);
stop();
throw e;
}
}
} catch (IOException ioe) {
throw new TunnelException("Error while processing streams", ioe);
}
if (logger.isDebugEnabled()) {
logger.debug("Completed reader thread for: " + this);
}
}