Package com.google.cloud.hadoop.util
Class IoExceptionHelper
java.lang.Object
com.google.cloud.hadoop.util.IoExceptionHelper
Translates exceptions from API calls into higher-level meaning, while allowing injectability for
testing how API errors are handled.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanDetermines if a givenThrowableis caused by an IO error.static booleanDetermines if a givenIOExceptionis caused by a timed out read.static booleanisSocketError(Throwable throwable) Determines if a givenThrowableis caused by a socket error.
-
Method Details
-
isIoError
Determines if a givenThrowableis caused by an IO error.Recursively checks
getCause()if outer exception isn't an instance of the correct class. -
isSocketError
Determines if a givenThrowableis caused by a socket error.Recursively checks
getCause()if outer exception isn't an instance of the correct class. -
isReadTimedOut
Determines if a givenIOExceptionis caused by a timed out read.- Parameters:
e- TheIOExceptionto check.- Returns:
- True if the
IOExceptionis a result of a read timeout.
-