Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More informative 'Authenticate' error message #42

Closed
kevinburke opened this issue Jan 8, 2012 · 2 comments
Closed

More informative 'Authenticate' error message #42

kevinburke opened this issue Jan 8, 2012 · 2 comments

Comments

@kevinburke
Copy link
Contributor

here's the current error message if someone provides incorrect accountsid/password combo:

Traceback (most recent call last):
  File "test_sms.py", line 8, in <module>
    body="Hello there!")
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/twilio/rest/resources.py", line 1022, in create
    return self.create_instance(params)
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/twilio/rest/resources.py", line 295, in create_instance
    resp, instance = self.request("POST", self.uri, data=body)
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/twilio/rest/resources.py", line 195, in request
    resp = make_twilio_request(method, uri, auth=self.auth, **kwargs)
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/twilio/rest/resources.py", line 168, in make_twilio_request
    raise TwilioRestException(resp.status_code, resp.url, message)
twilio.TwilioRestException: HTTP ERROR 401: 20003: Authenticate 
 https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXX/SMS/Messages.json

It would be great if we could provide some more context or a more informative message here.

@kevinburke
Copy link
Contributor Author

This might need to be a better error message in the API. Looks like the error message printing is good.

twilio.TwilioRestException: HTTP ERROR 400: 21606: The From phone number provided is not a valid, SMS-capable inbound phone number for your account. 
 https://api.twilio.com/2010-04-01/Accounts/AC58f1e8f2b1c6b88ca90a012a4be0c279/SMS/Messages.json 

@kevinburke
Copy link
Contributor Author

closing, we surface better error messages in the API now

dougblack added a commit that referenced this issue May 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant