if(cause instanceof InterruptedIOException) { return new ConnectionTimeoutException(buffer.toString(), failure); return new ConnectionTimeoutException(buffer.toString(), failure);
log.warn(String.format("Timeout opening data socket %s", failure.getMessage()));
case HttpStatus.SC_GATEWAY_TIMEOUT: case HttpStatus.SC_BAD_GATEWAY: return new ConnectionTimeoutException(buffer.toString(), failure); case HttpStatus.SC_INTERNAL_SERVER_ERROR: case HttpStatus.SC_SERVICE_UNAVAILABLE:
@Override public BackgroundException map(final ExceptionUDT e) { final StringBuilder buffer = new StringBuilder(); this.append(buffer, e.getError().getDescription()); switch(e.getError()) { case NOSERVER: case ECONNSETUP: case ECONNFAIL: case ECONNLOST: case ECONNREJ: return new ConnectionRefusedException(buffer.toString(), e); case ETIMEOUT: case EINVSOCK: return new ConnectionTimeoutException(buffer.toString(), e); case EWRPERM: return new AccessDeniedException(buffer.toString(), e); case EINVPARAM: return new InteroperabilityException(buffer.toString(), e); case USER_DEFINED_MESSAGE: // Handle UDT Error : -4 : user defined message : UDT send time out [id: 0x3223fa70] case WRAPPER_UNKNOWN: case WRAPPER_UNIMPLEMENTED: case WRAPPER_MESSAGE: return new InteroperabilityException(buffer.toString(), e); } return this.wrap(e, buffer); } }
@Override public BackgroundException map(final StorageException e) { final StringBuilder buffer = new StringBuilder(); this.append(buffer, e.getMessage()); if(ExceptionUtils.getRootCause(e) instanceof UnknownHostException) { return new NotfoundException(buffer.toString(), e); } switch(e.getHttpStatusCode()) { case 403: return new LoginFailureException(buffer.toString(), e); case 404: return new NotfoundException(buffer.toString(), e); case 304: case 405: case 400: case 411: case 412: return new InteroperabilityException(buffer.toString(), e); case 500: // InternalError // OperationTimedOut return new ConnectionTimeoutException(buffer.toString(), e); case 503: // ServerBusy return new RetriableAccessDeniedException(buffer.toString(), e); } return this.wrap(e, buffer); } }
switch(e.getErrorCode()) { case "RequestTimeout": return new ConnectionTimeoutException(buffer.toString(), e); case "ExpiredToken": case "InvalidToken":