twilio/twilio-python — pull request #100 by moses-palmer (2012-12-12 09:53:11+00:00)
Title: Pass the Twilio error code with TwilioRestException

These commits add the 'code' attribute to TwilioRestException. It is set from the 'code' attribute of the response in make_twilio_request.

We use this to check the reason for failure when sending an SMS to avoid having to parse the error message.