Common exception for the CognitoIdentity service.
Inheritance: Amazon.Runtime.AmazonServiceException
コード例 #1
0
 private bool ShouldRetry(AmazonCognitoIdentityException e)
 {
     if (_identityState.LoginSpecified && ((e is NotAuthorizedException && e.Message.StartsWith("Access to Identity", StringComparison.OrdinalIgnoreCase)) || e is ResourceNotFoundException))
     {
         identityId = null;
         ClearIdentityCache();
         return(true);
     }
     return(false);
 }
コード例 #2
0
        /// <summary>
        /// Checks the exception from a call that used an identity id and determines if the
        /// failure was caused by a cached identity id. If it was determined then the cache
        /// is cleared and true is return.
        /// </summary>
        /// <param name="e"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        private bool ShouldRetry(AmazonCognitoIdentityException e, GetIdentityIdStatus status)
        {
            if (status.FromCache &&
                ((e is NotAuthorizedException && e.Message.StartsWith("Access to Identity", StringComparison.OrdinalIgnoreCase)) ||
                 e is ResourceNotFoundException)
                )
            {
                this.identityId = null;
                this.ClearIdentityCache();

                return(true);
            }

            return(false);
        }
コード例 #3
0
        /// <summary>
        /// Checks the exception from a call that used an identity id and determines if the 
        /// failure was caused by a cached identity id. If it was determined then the cache
        /// is cleared and true is return.
        /// </summary>
        /// <param name="e"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        private bool ShouldRetry(AmazonCognitoIdentityException e, GetIdentityIdStatus status)
        {
            if (status.FromCache &&
                    ((e is NotAuthorizedException && e.Message.StartsWith("Access to Identity", StringComparison.OrdinalIgnoreCase)) ||
                      e is ResourceNotFoundException)
               )
            {
                this.identityId = null;
                this.ClearIdentityCache();

                return true;
            }

            return false;
        }