Skip to content

Commit 3d39d8d

Browse files
hakansuluogluminbi
authored andcommitted
Update CognitoUser.java
adding another catch statement for UserNotFoundException
1 parent fa07a0a commit 3d39d8d

File tree

1 file changed

+3
-1
lines changed
  • aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/mobileconnectors/cognitoidentityprovider

1 file changed

+3
-1
lines changed

aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/mobileconnectors/cognitoidentityprovider/CognitoUser.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,8 +951,10 @@ protected CognitoUserSession getCachedSession() {
951951
} catch (final NotAuthorizedException nae) {
952952
clearCachedTokens();
953953
throw new CognitoNotAuthorizedException("User is not authenticated", nae);
954-
} catch (final Exception e) {
954+
} catch (final UserNotFoundException unfe) {
955955
clearCachedTokens();
956+
throw new CognitoNotAuthorizedException("User does not exist", unfe);
957+
}catch (final Exception e) {
956958
throw new CognitoInternalErrorException("Failed to authenticate user", e);
957959
}
958960
}

0 commit comments

Comments
 (0)