~ubuntu-branches/ubuntu/trusty/piston-mini-client/trusty-proposed

« back to all changes in this revision

Viewing changes to piston_mini_client/failhandlers.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2011-08-11 17:26:42 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20110811172642-pwbja8hb8u0lvy16
Tags: 0.5+bzr41-0ubuntu1
new bzr snapshot that supports overriding the httplib2
signature checks

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
    'MultiExceptionFailHandler',
18
18
]
19
19
 
 
20
from piston_mini_client.consts import DEBUG_ENVVAR
20
21
import os
21
22
 
22
23
class APIError(Exception):
23
24
    def __init__(self, msg, body=None):
24
25
        self.msg = msg
25
26
        self.body = body
26
 
        self.debug = os.environ.get('PISTON_MINI_CLIENT_DEBUG', False)
 
27
        self.debug = os.environ.get(DEBUG_ENVVAR, False)
27
28
    def __str__(self):
28
29
        if self.debug:
29
30
            return "%s\nReceived body:\n%s" % (self.msg, self.body)