public boolean rateLimited ( GoogleJsonError e ) { ErrorInfo errorInfo = getErrorInfo ( e ) ; if ( errorInfo != null ) { String domain = errorInfo . getDomain ( ) ; String reason = errorInfo . getReason ( ) ; boolean isRateLimitedOrGlobalDomain = USAGE_LIMITS_DOMAIN . equals ( domain ) || GLOBAL_DOMAIN . equals ( domain ) ; boolean isRateLimitedReason = RATE_LIMITED_REASON_CODE . equals ( reason ) || USER_RATE_LIMITED_REASON_CODE . equals ( reason ) ; return isRateLimitedOrGlobalDomain && isRateLimitedReason ; } return false ; }
Determine if a given GoogleJsonError is caused by and only by a rate limit being applied .