catch MIN_TRADE_REQUIREMENT_NOT_MET as non-critical exception (#237)

* add MIN_TRADE_REQUIREMENT_NOT_MET to response validation

* implement test
This commit is contained in:
Michael Egger
2017-12-26 09:39:29 +01:00
committed by GitHub
parent de33d69eed
commit a514b92dcf
2 changed files with 38 additions and 2 deletions

View File

@@ -45,8 +45,12 @@ class Bittrex(Exchange):
Validates the given bittrex response
and raises a ContentDecodingError if a non-fatal issue happened.
"""
if response['message'] == 'NO_API_RESPONSE':
raise ContentDecodingError('Unable to decode bittrex response')
temp_error_messages = [
'NO_API_RESPONSE',
'MIN_TRADE_REQUIREMENT_NOT_MET',
]
if response['message'] in temp_error_messages:
raise ContentDecodingError('Got {}'.format(response['message']))
@property
def fee(self) -> float: