From 18af5e65de0f3cf5e49b47812cefb8e88448c24f Mon Sep 17 00:00:00 2001 From: Daniel Krol Date: Tue, 14 Jun 2022 10:58:45 -0400 Subject: [PATCH] Throw exception from SDK API --- test_client/test_client.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test_client/test_client.py b/test_client/test_client.py index c216278..dba6a0b 100755 --- a/test_client/test_client.py +++ b/test_client/test_client.py @@ -96,11 +96,15 @@ class WalletSync(): response = requests.get(cls.WALLET_URL, params=params) # TODO check response version on client side now + if response.status_code == 404: + print ('Wallet not found') + # "No wallet" is not an error, so no exception raised + return None, None if response.status_code != 200: print ('Error', response.status_code) print (response.content) - return None, None + raise Exception("Unexpected status code") wallet_state = WalletState( encrypted_wallet=response.json()['encryptedWallet'], @@ -133,7 +137,7 @@ class WalletSync(): else: print ('Error', response.status_code) print (response.content) - return None, None, None + raise Exception("Unexpected status code") wallet_state = WalletState( encrypted_wallet=response.json()['encryptedWallet'],