This repository has been archived by the owner on Apr 3, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(errors): make email-sending errors a 422 for new addresses
In 75815f2, we added an error for email-sending failure to some routes. Quite reasonably, we made it a 500 on the assumption that it probably indicated a problem somewhere in our email-sending infrastructure, but it turns out that in most cases it indicates a user mistyped their email address. That causes Sentry to alert us pretty noisily, so this change seeks to return a 422 instead in cases where the email address is unverified. Some rationale behind that decision: * We still want actual infrastructure errors to be a 500, so I opted to keep the 500 in place on `/account/login` for verified accounts. * For unverified accounts in `/account/login`, `/account/create` and `POST /recovery_email`, I wanted something different to a 400 so that it was distinct from our regular validation errors. The description for 422 seemed like a good appropriation for that. * I avoided adding a new errno because that would require a knock-on change in the content server, and we want to target this as a point release for train 123.
- Loading branch information
Showing
7 changed files
with
24 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters