diff --git a/Connect.py b/Connect.py index 5a8be26..88495a6 100644 --- a/Connect.py +++ b/Connect.py @@ -197,6 +197,7 @@ def _login_url(self): def interactive_login(self): """Send the login url to which a user should receive the token.""" + response = None try: params = { "appKey": self.apiKey, @@ -210,7 +211,10 @@ def interactive_login(self): response['result']['isInvestorClient']) return response except Exception as e: - return response['description'] + if response and 'description' in response: + return response['description'] + else: + return str(e) def get_order_book(self, clientID=None): """Request Order book gives states of all the orders placed by an user"""