mozilla / fxa-auth-server

DEPRECATED - Migrated to https://github.com/mozilla/fxa
Mozilla Public License 2.0
399 stars 121 forks source link

fix(sms): catch errors thrown from phoneNumberUtil.parse #2897

Closed philbooth closed 5 years ago

philbooth commented 5 years ago

Ref: https://sentry.prod.mozaws.net/operations/auth-prod/issues/5170677/?environment=prod

It turns out, sometimes phoneNumberUtil.parse throws instead of signalling state via phoneNumberUtil.isValidNumber, which I didn't realise when I wrote the code. This just ensures we catch those errors and return the appropriate 400 error instead of a 500.

@mozilla/fxa-devs r?

vladikoff commented 5 years ago

awesome!