/** * @param rootThrowable The original throwable * @param throwable The throwable under direct scrutiny. */ @Override protected void checkForInsufficientStorageException(final Throwable rootThrowable, final Throwable throwable) throws InvalidChecksumException { final String message = throwable.getMessage(); if (throwable instanceof IOException && message != null && message.contains( INSUFFICIENT_SPACE_IDENTIFYING_MESSAGE)) { throw new InsufficientStorageException(throwable.getMessage(), rootThrowable); } if (throwable.getCause() != null) { checkForInsufficientStorageException(rootThrowable, throwable.getCause()); } if (rootThrowable instanceof InvalidChecksumException) { throw (InvalidChecksumException) rootThrowable; } else if (rootThrowable instanceof RuntimeException) { throw (RuntimeException) rootThrowable; } else { throw new RepositoryRuntimeException(rootThrowable); } }
/** * @param rootThrowable The original throwable * @param throwable The throwable under direct scrutiny. * @throws InvalidChecksumException in case there was a checksum mismatch */ protected void checkForInsufficientStorageException(final Throwable rootThrowable, final Throwable throwable) throws InvalidChecksumException { final String message = throwable.getMessage(); if (throwable instanceof IOException && message != null && message.contains( INSUFFICIENT_SPACE_IDENTIFYING_MESSAGE)) { throw new InsufficientStorageException(throwable.getMessage(), rootThrowable); } if (throwable.getCause() != null) { checkForInsufficientStorageException(rootThrowable, throwable.getCause()); } if (rootThrowable instanceof InvalidChecksumException) { throw (InvalidChecksumException) rootThrowable; } else if (rootThrowable instanceof RuntimeException) { throw (RuntimeException) rootThrowable; } else { throw new RepositoryRuntimeException(rootThrowable); } } }