# HG changeset patch # User Peter Sanchez # Date 1450902928 28800 # Wed Dec 23 12:35:28 2015 -0800 # Node ID 4164a246d3e97384f9e1aa32db8d144d9e6829d5 # Parent 7e09f21a22f2abc4aaabd5139946bc1195625c56 Added json error data to RequestError exception for future debugging. diff --git a/tinder/binder.py b/tinder/binder.py --- a/tinder/binder.py +++ b/tinder/binder.py @@ -111,7 +111,7 @@ data = response.json() if 'status' in data: if data['status'] != self.success_status_code: - raise RequestError(data['status']) + raise RequestError(data, data['status']) return self.data_model(data, self.api) \ if self.data_model is not None else data diff --git a/tinder/exceptions.py b/tinder/exceptions.py --- a/tinder/exceptions.py +++ b/tinder/exceptions.py @@ -7,4 +7,6 @@ class RequestError(Exception): - pass + def __init__(self, json_data, *args, **kwargs): + self._json_data = json_data + super(RequestError, self).__init__(*args, **kwargs)