-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[datadog_users] Don't panic if no users is found #2302
Conversation
f599068
to
3d5202e
Compare
// We already raised an exception if multiple users were found but no exact email match. | ||
// If user is nil at this stage, we can assume a user with the same handle already exists. | ||
// Find the user and raise a helpful error message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see there is a check for statuscode 409 at the top, why not return the error message for user already exists with handle there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At that stage its still recoverable - if the create call 409 conflicts with a disabled user with the same handle and matching email, that user can be re-enabled. Its only an exception if the handle and email of the old user doesn't match, because then we can't resolve which user is being re-enabled.
Closes: #2292