private void handleServiceException(ServiceException e) throws IOException { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } else { if(LOG.isDebugEnabled()) { LOG.debug("Got ServiceException with Error code: " + e.getErrorCode() + ";and Error message: " + e.getErrorMessage()); } } }
public static boolean isServiceExceptionRecoverable(ServiceException ex) { final boolean isIOException = ex.getCause() instanceof IOException; final boolean isTimeout = "RequestTimeout".equals(((ServiceException) ex).getErrorCode()); return isIOException || isTimeout; }
@Override public InputStream openStream() throws IOException { try { return buildFileObject(uri, s3Client).openInputStream(); } catch (ServiceException e) { if (e.getCause() != null) { if (S3Utils.S3RETRY.apply(e)) { throw new IOException("Recoverable exception", e); } } throw Throwables.propagate(e); } } };
if(e.getCause() instanceof IOException && ioErrorRetryCount < 5) { ioErrorRetryCount++; if(log.isWarnEnabled()) {
if(e.getCause() instanceof IOException && ioErrorRetryCount < 5) { ioErrorRetryCount++; if(log.isWarnEnabled()) {
ioErrorRetryCount = 0; } catch (ServiceException se) { if (se.getCause() instanceof IOException && ioErrorRetryCount < 5) { ioErrorRetryCount++; if (log.isWarnEnabled()) {
ioErrorRetryCount = 0; } catch (ServiceException e) { if (e.getCause() instanceof IOException && ioErrorRetryCount < ioErrorRetryMaxCount)
ioErrorRetryCount = 0; } catch (ServiceException se) { if (se.getCause() instanceof IOException && ioErrorRetryCount < 5) { ioErrorRetryCount++; if (log.isWarnEnabled()) {
ioErrorRetryCount = 0; } catch (ServiceException e) { if (e.getCause() instanceof IOException && ioErrorRetryCount < ioErrorRetryMaxCount)
@Override public BackgroundException map(final ServiceException e) { if(e.getCause() instanceof ServiceException) { return this.map((ServiceException) e.getCause()); if(e.getCause() instanceof IOException) { return new DefaultIOExceptionMappingService().map((IOException) e.getCause()); if(e.getCause() instanceof SAXException) { return new InteroperabilityException(buffer.toString(), e);
/** * Wrap a ServiceException as an S3ServiceException. * @param se */ public S3ServiceException(ServiceException se) { super(se.getMessage(), se.getXmlMessage(), se.getCause()); this.setResponseHeaders(se.getResponseHeaders()); this.setResponseCode(se.getResponseCode()); this.setResponseStatus(se.getResponseStatus()); this.setResponseDate(se.getResponseDate()); this.setRequestVerb(se.getRequestVerb()); this.setRequestPath(se.getRequestPath()); this.setRequestHost(se.getRequestHost()); }
/** * Wrap a ServiceException as an S3ServiceException. * @param se */ public S3ServiceException(ServiceException se) { super(se.getMessage(), se.getXmlMessage(), se.getCause()); this.setResponseHeaders(se.getResponseHeaders()); this.setResponseCode(se.getResponseCode()); this.setResponseStatus(se.getResponseStatus()); this.setResponseDate(se.getResponseDate()); this.setRequestVerb(se.getRequestVerb()); this.setRequestPath(se.getRequestPath()); this.setRequestHost(se.getRequestHost()); }