Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion notecard/notecard.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def Transaction(self, req, lock=True):
continue

if 'err' in rsp_json:
if '{io}' in rsp_json['err']:
if '{io}' in rsp_json['err'] and '{not-supported}' not in rsp_json['err']:
if self._debug:
print('Response has error field indicating ' + \
f'I/O error: {rsp_json}')
Expand Down
10 changes: 10 additions & 0 deletions test/test_notecard.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,16 @@ def test_transaction_retries_on_io_error_in_response(
assert card._transact.call_count == \
notecard.CARD_TRANSACTION_RETRIES

def test_transaction_does_not_retry_on_not_supported_error_in_response(
self, arrange_transaction_test):
card = arrange_transaction_test()
req = {"req": "hub.status"}

with patch('notecard.notecard.json.loads',
return_value={'err': 'some error {io} {not-supported}'}):
card.Transaction(req)
assert card._transact.call_count == 1

def test_transaction_does_not_retry_on_bad_bin_error_in_response(
self, arrange_transaction_test):
card = arrange_transaction_test()
Expand Down