Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Return 400 on Twilio errors #1313

Merged
merged 1 commit into from
Dec 10, 2020
Merged

Return 400 on Twilio errors #1313

merged 1 commit into from
Dec 10, 2020

Conversation

sethvargo
Copy link
Member

These are nearly always client errors

Fixes #1310

Release Note

Return 400 (instead of 500) on Twilio errors

These are nearly always client errors
@google-cla google-cla bot added the cla: yes Auto: added by CLA bot when all committers have signed a CLA. label Dec 10, 2020
@sethvargo
Copy link
Member Author

/assign @whaught

I thought about parsing the code, but there are over 10k possible codes, and only 14 of them are internal server errors: https://www.twilio.com/docs/api/errors

Copy link
Contributor

@whaught whaught left a comment

Choose a reason for hiding this comment

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

Well this works.

I wonder if we want to go the other way and select a few eg. 503 unknown to keep as Server error

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sethvargo, whaught

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot google-oss-robot merged commit da9e7f3 into main Dec 10, 2020
@google-oss-robot google-oss-robot deleted the sethvargo/sms_error branch December 10, 2020 05:13
@whaught
Copy link
Contributor

whaught commented Dec 10, 2020

/assign @whaught

I thought about parsing the code, but there are over 10k possible codes, and only 14 of them are internal server errors: https://www.twilio.com/docs/api/errors

Just picking one at random: error code 90002: "too many errors" error. This list is a little ridiculous

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Auto: added by CLA bot when all committers have signed a CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pass through Twilio 4xx errors to the caller
3 participants