Skip to content
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

Need to handle 5xx error for duplication of emailAddress and throw a 4xx error #299

Closed
option-greek opened this issue Apr 8, 2020 · 0 comments
Assignees
Labels
type: bug 🐛 Something isn't working
Milestone

Comments

@option-greek
Copy link

Describe the bug
When createCustomer Mutation is called twice with the same emailAddress, it throws a 5xx error during insertion of record:

[run:server] error 4/8/20, 5:45 PM - [Vendure Server] INTERNAL_SERVER_ERROR: error.email-address-must-be-unique
[run:server] Error: error.email-address-must-be-unique
[run:server]     at CustomerService.create 

To Reproduce
Steps to reproduce the behavior:
Run the below mutation twice:
mutation {
createCustomer(input: {title: "Mr", firstName: "Okjfkgjfg", lastName: "Gdfdfdfj", phoneNumber: "+910086609277", emailAddress: "1234@gmail.com"}, password: "b7a43ae5fd") {
id
}
}

Expected behavior
Should throw a 4xx error (may be 400 bad request ?)

Environment (please complete the following information):

  • @vendure/core version: v0.9.0)
  • Nodejs version any
  • Database (mysql/postgres etc): sqlite

Additional context
Add any other context about the problem here.

@option-greek option-greek added the type: bug 🐛 Something isn't working label Apr 8, 2020
@michaelbromley michaelbromley added this to the v0.11.1 milestone Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants