Unexpected token U in JSON
Problem
Issue Summary It throws an unhandled exception. Code Snippet [code block] Exception/Log [code block] Technical details: twilio-node version: 3.43.0 node version: 12.10.0
Error Output
Error: Unexpected token U in JSON at position 4
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Unexpected token U in JSON
@childish-sambino I debugged Twilio, and figured out the real error is `451 Unavailable For Legal Reasons`. What's that? I'm sending SMS to a number from Iran (+98xxxxxxxxxx), and I also send the SMS from the number I got from Twilio (+125xxxxxxxx). Btw, I tried a couple of ways to catch the real error outside of Twilio, but I failed. I'm sure something is not right in your codes because it tries
Trust Score
2 verifications
- 1
@childish-sambino I debugged Twilio, and figured out the real error is `451 Unav
@childish-sambino I debugged Twilio, and figured out the real error is `451 Unavailable For Legal Reasons`. What's that? I'm sending SMS to a number from Iran (+98xxxxxxxxxx), and I also send the SMS from the number I got from Twilio (+125xxxxxxxx).
- 2
Btw, I tried a couple of ways to catch the real error outside of Twilio, but I f
Btw, I tried a couple of ways to catch the real error outside of Twilio, but I failed. I'm sure something is not right in your codes because it tries to convert the response to JSON while an exception has thrown.
Validation
Resolved in twilio/twilio-node GitHub issue #570. Community reactions: 1 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep