private static ThrowableInfo causedByRetryableException()

in services/library/src/main/java/com/google/cloud/pso/bq_pii_classifier/helpers/ControllerExceptionHelper.java [113:132]


    private static ThrowableInfo causedByRetryableException(Throwable throwable){

        // check if the given throwable is Retryable
        ThrowableInfo throwableInfo = isRetryableException(throwable);

        // if so, stop here (recursion base case)
        if (throwableInfo.isRetryable())
            return throwableInfo;
        else{
            // if it has a cause, check if that cause is retryable

            // if it has no cause. Stop here (recursion base case)
            if (throwable.getCause() == null){
                return new ThrowableInfo(throwable, false, "");
            }else{
                // if it has a cause, check if it's retryable (recursion)
                return causedByRetryableException(throwable.getCause());
            }
        }
    }