Skip to content

Commit

Permalink
Check for 'error' in response also since bitfinex's api is inconsistent.
Browse files Browse the repository at this point in the history
eg. `ERR_RATE_LIMIT` is reported as 'error' not 'message'.
  • Loading branch information
greatwolf committed Oct 11, 2017
1 parent 4769bec commit 0e882f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/exchanges/bitfinex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ static RestApi& queryHandle(Parameters &params)
static json_t* checkResponse(std::ostream &logFile, json_t *root)
{
auto msg = json_object_get(root, "message");
if (!msg) msg = json_object_get(root, "error");

if (msg)
logFile << "<Bitfinex> Error with response: "
<< json_string_value(msg) << '\n';
Expand Down

0 comments on commit 0e882f9

Please sign in to comment.