'Try to pretty-print the exception, if this is going on screen.'

def __str__(self):

    def red(words):
        return (u('\x1b[31m\x1b[49m%s\x1b[0m') % words)
    def white(words):
        return (u('\x1b[37m\x1b[49m%s\x1b[0m') % words)
    def blue(words):
        return (u('\x1b[34m\x1b[49m%s\x1b[0m') % words)
    def teal(words):
        return (u('\x1b[36m\x1b[49m%s\x1b[0m') % words)
    def get_uri(code):
        return 'https://www.twilio.com/docs/errors/{0}'.format(code)
    if (hasattr(sys.stderr, 'isatty') and sys.stderr.isatty()):
        msg = '\n{red_error}    {request_was}\n\n{http_line}\n\n{twilio_returned}\n\n{message}\n'.format(red_error=red('HTTP    Error'), request_was=white('Your    request    was:'), http_line=teal(('%s    %s' % (self.method, self.uri))), twilio_returned=white('Twilio    returned    the    following    information:'), message=blue(str(self.msg)))
        if self.code:
            msg = ''.join([msg, '\n{more_info}\n\n{uri}\n\n'.format(more_info=white('More    information    may    be    available    here:'), uri=blue(get_uri(self.code)))])
        return msg
    else:
        return 'HTTP    {0}    error:    {1}'.format(self.status, self.msg)
