Closed ghost closed 6 years ago
Hi @donglesquare
Instead of concatenating strings and other types of variables it can be best to use the str format()
function, your example above would become
error msg = 'KU API error with code: {} msg: {}'.format(e.status_code, e.message)
It seems like 502 Bad Gateway response has to raise KucoinRequestException since it is not a valid json format. I wrote a code to print out error code and error message when KucoinAPIException has been raised.
The following is how I handle KucoinAPIException
And at this time, it raises TypeError remarks that I cannot convert bytes to str implicitly.