MPP-3722, MPP-3513, MPP-3890, MPP-3373: Handle more errors when relaying SMS messages #5001
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses a few tickets, to remove some 500 errors from the service:
RelaySMSException
classes to be based onRelayAPIException
ftl_id
on the exception classes, to make it easier to cross-reference exceptions to the translated versions/phones/exceptions.py
NoPhoneLog
message with translationsTemplateTwiMLRenderer
to handleRelaySMSException
without having to wrap inrest_framework.exceptions.ValidationError
RelaySMSException
, keep forValidationError
ShortPrefixMatchesNoSenders
- Log at INFO instead of sending an exception to Sentry. This is done for all exceptions derived fromRelaySMSException
, for Twilio and iQphonenumbers
, skip it rather than raise the exceptionSTOP
to their Relay number, we can't send them any more messages. Log this as INFO and reply with an empty "OK" response to Twilio. This prevents the 500 error, but doesn't help the Relay user discover the issue. An obvious next step is to set a flag on theRelayNumber
orRealNumber
that the user has blocked their Relay number, so we can show that in the frontend.If this is too much for one PR, I can break it up.
How to test:
I've added or updated relevant docs in the docs/ directory.All UI revisions follow the coding standards, and use Protocol tokens where applicable (see/frontend/src/styles/tokens.scss
).