public final FetchException toFetchException ( final String message ) { Throwable cause ; if ( this instanceof FetchException ) { cause = this ; } else { cause = getCause ( ) ; } if ( cause == null ) { cause = this ; } else if ( cause instanceof FetchException && message == null ) { return ( FetchException ) cause ; } String causeMessage = cause . getMessage ( ) ; if ( causeMessage == null ) { causeMessage = message ; } else if ( message != null ) { causeMessage = message + " : " + causeMessage ; } return makeFetchException ( causeMessage , cause ) ; }
Converts RepositoryException into an appropriate FetchException prepending the specified message . If message is null original exception message is preserved .