Skip to content

Conversation

@bojeil-google
Copy link
Contributor

Catch EMAIL_NOT_FOUND and translate to EmailNotFoundError when /accounts:sendOobCode is called for password reset on a user that does not exist.

Catch EMAIL_NOT_FOUND and translate to EmailNotFoundError  when /accounts:sendOobCode is called for password reset on a user that does not exist.
Copy link
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @bojeil-google !
LGTM. Please add a TW to review the reference doc changes.

Copy link
Contributor

@hiranya911 hiranya911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One possible typo. Can we also add a test case? Similar to:

def test_get_user_non_existing(self, user_mgt_app):

Raises:
ValueError: If the provided arguments are invalid
UserNotFoundError: If no user exists by the specified email address.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be EmailNotFoundError?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this is the problem. They throw different errors. For password reset, they throw EMAIL_NOT_FOUND. For email verification, they throw USER_NOT_FOUND.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, fair enough 👍

@bojeil-google
Copy link
Contributor Author

One possible typo. Can we also add a test case? Similar to:

def test_get_user_non_existing(self, user_mgt_app):

Done

Copy link
Contributor

@hiranya911 hiranya911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LGTM!

@hiranya911 hiranya911 assigned egilmorez and unassigned hiranya911 May 3, 2021
Copy link

@egilmorez egilmorez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG, one tiny nit.

Raises:
ValueError: If the provided arguments are invalid
EmailNotFoundError: If no user exists by the specified email address.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason to use "by" here?

I'd expect "for" probably, here and below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching. I copied and pasted blindly. It is fixed now here and elsewhere.

@bojeil-google bojeil-google merged commit 527a824 into master May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants