'Wraps an exceptional response in a `TwilioRestException`.'

@classmethod
def exception(cls, method, uri, response, message):

    try:
        error_payload = json.loads(response.text)
        if ('message' in error_payload):
            message = '{}:    {}'.format(message, error_payload['message'])
        code = error_payload.get('code', response.status_code)
        return TwilioRestException(response.status_code, uri, message, code, method)
    except:
        return TwilioRestException(response.status_code, uri, message, response.status_code, method)
