Adds handling for more region errors in Telnyx (#639)

This commit is contained in:
Chris Anderson 2025-03-05 14:05:03 -06:00 committed by GitHub
parent 1d02605099
commit 30bde64257
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -82,7 +82,7 @@ export default class TelnyxTextProvider extends TextProvider {
if (error?.code === '40300') {
// Unable to send because recipient has unsubscribed
throw new UnsubscribeTextError(this.type, to, error.title)
} else if (error?.code === '40008') {
} else if (error?.code === '40008' || error?.code === '40301') {
// Unable to send because region is not enabled
throw new UndeliverableTextError(this.type, to, error.title)
}