summaryrefslogtreecommitdiff
path: root/barbicanclient/common/exceptions.py
blob: 49c5f6ab253e92ad247b1b4526062960aa66284b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class ClientException(Exception):
    """Exception for wrapping up Barbican client errors"""
    def __init__(self, href='', http_status=0,
                 method='', http_response_content=''):

        self.method = method
        self.href = href
        self.http_status = http_status
        self.http_response_content = http_response_content

        msg = "%s %s returned %d with msg: %s" % (self.method,
                                                  self.href,
                                                  self.http_status,
                                                  self.http_response_content)
        Exception.__init__(self, msg)