From 0c5469c1bcd319e9ce1dd981a1eb97c5ca5724c0 Mon Sep 17 00:00:00 2001 From: pavan-maddula Date: Mon, 28 Jan 2019 13:05:26 +0530 Subject: [PATCH] Add attributes to ResponseError --- .travis.yml | 4 ++-- kwikapi/exception.py | 6 +++++- setup.py | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d731baf..12d573c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,8 @@ deploy: - LICENSE - kwikapi/api.py - kwikapi/__init__.py - name: kwikapi-0.5.1 - tag_name: 0.5.1 + name: kwikapi-0.5.2 + tag_name: 0.5.2 on: repo: deep-compute/kwikapi - provider: pypi diff --git a/kwikapi/exception.py b/kwikapi/exception.py index a032df5..7b8f203 100644 --- a/kwikapi/exception.py +++ b/kwikapi/exception.py @@ -3,7 +3,11 @@ class ResponseError(Exception): - pass + def __init__(self, response): + super(ResponseError, self).__init__(response) + self.message = response['message'] + self.code = response['code'] + self.callee_error = response['error'] class BaseException(Exception): diff --git a/setup.py b/setup.py index 49df893..4bfef49 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '0.5.1' +version = '0.5.2' setup( name="kwikapi", version=version,