public static AuthException lookup()

in aws-auth-cognito/src/main/java/com/amplifyframework/auth/cognito/util/CognitoAuthExceptionConverter.java [57:128]


    public static AuthException lookup(@NonNull Exception error, @NonNull String fallbackMessage) {
        if (error instanceof UserNotFoundException) {
            return new AuthException.UserNotFoundException(error);
        }

        if (error instanceof UserNotConfirmedException) {
            return new AuthException.UserNotConfirmedException(error);
        }

        if (error instanceof UsernameExistsException) {
            return new AuthException.UsernameExistsException(error);
        }

        if (error instanceof AliasExistsException) {
            return new AuthException.AliasExistsException(error);
        }

        if (error instanceof InvalidPasswordException) {
            return new AuthException.InvalidPasswordException(error);
        }

        if (error instanceof InvalidParameterException) {
            return new AuthException.InvalidParameterException(error);
        }

        if (error instanceof ExpiredCodeException) {
            return new AuthException.CodeExpiredException(error);
        }

        if (error instanceof CodeMismatchException) {
            return new AuthException.CodeMismatchException(error);
        }

        if (error instanceof CodeDeliveryFailureException) {
            return new AuthException.CodeDeliveryFailureException(error);
        }

        if (error instanceof LimitExceededException) {
            return new AuthException.LimitExceededException(error);
        }

        if (error instanceof MFAMethodNotFoundException) {
            return new AuthException.MFAMethodNotFoundException(error);
        }

        if (error instanceof NotAuthorizedException) {
            return new AuthException.NotAuthorizedException(error);
        }

        if (error instanceof ResourceNotFoundException) {
            return new AuthException.ResourceNotFoundException(error);
        }

        if (error instanceof SoftwareTokenMFANotFoundException) {
            return new AuthException.SoftwareTokenMFANotFoundException(error);
        }

        if (error instanceof TooManyFailedAttemptsException) {
            return new AuthException.FailedAttemptsLimitExceededException(error);
        }

        if (error instanceof TooManyRequestsException) {
            return new AuthException.TooManyRequestsException(error);
        }

        if (error instanceof PasswordResetRequiredException) {
            return new AuthException.PasswordResetRequiredException(error);
        }

        return new AuthException(fallbackMessage, error, "See attached exception for more details.");

    }