department-of-veterans-affairs / notification-api

Notification API
MIT License
16 stars 9 forks source link

Handle Twilio Error Code 30500 #2104

Open k-macmillan opened 2 weeks ago

k-macmillan commented 2 weeks ago

User Story - Business Need

30500 is a Twilio internal error, and we should mark the notification as temporary-failure.

User Story(ies)

As a VA Notify client I want my notification updates to be as accurate as possible So that I can make informed decisions

Additional Info and Resources

The _evaluate_status method controls this behavior. This error code is not mapped, so it fell to a technical error. Add the mapping below to the twilio client twilio_error_code_map. There are too many Twilio statuses to effectively map, so we have to deal with them as we find them.

New constant for retryable:

    RETRYABLE_STATUS_REASON = 'Retryable - Notification is unable to be processed at this time. Replay the request to VA Notify.'
    '30500': TwilioStatus(30500, NOTIFICATION_TEMPORARY_FAILURE, RETRYABLE_STATUS_REASON),

Acceptance Criteria

QA Considerations

Potential Dependencies