mirror of
https://fast.feibisi.com/https://github.com/parcelvoy/platform.git
synced 2025-08-28 11:46:02 +08:00
Fixes assuming Telnyx error codes are numbers (#635)
This commit is contained in:
parent
0540af3ca9
commit
9e89e815e3
1 changed files with 2 additions and 2 deletions
|
@ -79,10 +79,10 @@ export default class TelnyxTextProvider extends TextProvider {
|
|||
|
||||
// https://support.telnyx.com/en/articles/6505121-telnyx-messaging-error-codes
|
||||
const error = responseBody.errors?.[0]
|
||||
if (error?.code === 40300) {
|
||||
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') {
|
||||
// Unable to send because region is not enabled
|
||||
throw new UndeliverableTextError(this.type, to, error.title)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue