Skip to content

Handle rate limiting errors from AWS Pinpoint#5543

Merged
zachmargolis merged 3 commits intomainfrom
margolis-voip-check-errors
Oct 26, 2021
Merged

Handle rate limiting errors from AWS Pinpoint#5543
zachmargolis merged 3 commits intomainfrom
margolis-voip-check-errors

Conversation

@zachmargolis
Copy link
Contributor

  • Fail open because we can't tell what a number is :[

- Fail open because we can't tell what a number is
end
rescue Aws::Pinpoint::Errors::TooManyRequestsException
@warning_message = 'AWS pinpoint phone info rate limit'
@phone_info = Telephony::PhoneNumberInfo.new(type: :unknown)
Copy link
Contributor

Choose a reason for hiding this comment

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

does :unknown mean we accept the number?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup, we only fail on :voip:

if @phone_info.type == :voip &&
!FeatureManagement.voip_allowed_phones.include?(parsed_phone.e164)
errors.add(:phone, I18n.t('errors.messages.voip_phone'))
elsif @phone_info.error
errors.add(:phone, I18n.t('errors.messages.voip_check_error'))
end

@zachmargolis zachmargolis merged commit 84f177e into main Oct 26, 2021
@zachmargolis zachmargolis deleted the margolis-voip-check-errors branch October 26, 2021 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants