{"action":"created","issue":{"url":"https://api.github.com/repos/ccxt/ccxt/issues/2713","repository_url":"https://api.github.com/repos/ccxt/ccxt","labels_url":"https://api.github.com/repos/ccxt/ccxt/issues/2713/labels{/name}","comments_url":"https://api.github.com/repos/ccxt/ccxt/issues/2713/comments","events_url":"https://api.github.com/repos/ccxt/ccxt/issues/2713/events","html_url":"https://github.com/ccxt/ccxt/issues/2713","id":319040147,"number":2713,"title":"Error handling issues in python 2.7","user":{"login":"tzachshabtay","id":1819001,"avatar_url":"https://avatars3.githubusercontent.com/u/1819001?v=4","gravatar_id":"","url":"https://api.github.com/users/tzachshabtay","html_url":"https://github.com/tzachshabtay","followers_url":"https://api.github.com/users/tzachshabtay/followers","following_url":"https://api.github.com/users/tzachshabtay/following{/other_user}","gists_url":"https://api.github.com/users/tzachshabtay/gists{/gist_id}","starred_url":"https://api.github.com/users/tzachshabtay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzachshabtay/subscriptions","organizations_url":"https://api.github.com/users/tzachshabtay/orgs","repos_url":"https://api.github.com/users/tzachshabtay/repos","events_url":"https://api.github.com/users/tzachshabtay/events{/privacy}","received_events_url":"https://api.github.com/users/tzachshabtay/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"kroitor","id":1294454,"avatar_url":"https://avatars3.githubusercontent.com/u/1294454?v=4","gravatar_id":"","url":"https://api.github.com/users/kroitor","html_url":"https://github.com/kroitor","followers_url":"https://api.github.com/users/kroitor/followers","following_url":"https://api.github.com/users/kroitor/following{/other_user}","gists_url":"https://api.github.com/users/kroitor/gists{/gist_id}","starred_url":"https://api.github.com/users/kroitor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kroitor/subscriptions","organizations_url":"https://api.github.com/users/kroitor/orgs","repos_url":"https://api.github.com/users/kroitor/repos","events_url":"https://api.github.com/users/kroitor/events{/privacy}","received_events_url":"https://api.github.com/users/kroitor/received_events","type":"User","site_admin":false},"assignees":[{"login":"kroitor","id":1294454,"avatar_url":"https://avatars3.githubusercontent.com/u/1294454?v=4","gravatar_id":"","url":"https://api.github.com/users/kroitor","html_url":"https://github.com/kroitor","followers_url":"https://api.github.com/users/kroitor/followers","following_url":"https://api.github.com/users/kroitor/following{/other_user}","gists_url":"https://api.github.com/users/kroitor/gists{/gist_id}","starred_url":"https://api.github.com/users/kroitor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kroitor/subscriptions","organizations_url":"https://api.github.com/users/kroitor/orgs","repos_url":"https://api.github.com/users/kroitor/repos","events_url":"https://api.github.com/users/kroitor/events{/privacy}","received_events_url":"https://api.github.com/users/kroitor/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2018-04-30T21:20:39Z","updated_at":"2018-05-01T15:35:26Z","closed_at":null,"author_association":"NONE","body":"Occasionally I get these errors when placing an order on gemini (it usually works):\r\n\r\n```\r\n  File \"/usr/local/lib/python2.7/dist-packages/ccxt/gemini.py\", line 213, in create_order\r\n    response = self.privatePostOrderNew(self.extend(order, params))\r\n  File \"/usr/local/lib/python2.7/dist-packages/ccxt/gemini.py\", line 276, in request\r\n    response = self.fetch2(path, api, method, params, headers, body)\r\n  File \"/usr/local/lib/python2.7/dist-packages/ccxt/base/exchange.py\", line 302, in fetch2\r\n    return self.fetch(request['url'], request['method'], request['headers'], request['body'])\r\n  File \"/usr/local/lib/python2.7/dist-packages/ccxt/base/exchange.py\", line 380, in fetch\r\n    self.raise_error(ExchangeError, url, method, e, self.last_http_response)\r\n  File \"/usr/local/lib/python2.7/dist-packages/ccxt/base/exchange.py\", line 287, in raise_error\r\n    raise exception_type(output)\r\nExchangeError: gemini https://api.gemini.com/v1/order/new POST ('Connection aborted.', BadStatusLine(\"''\",)) {\"order_id\":\"3609682318\",\"id\":\"3609682318\r\n\",\"symbol\":\"btcusd\",\"exchange\":\"gemini\",\"avg_execution_price\":\"0.00\",\"side\":\"buy\",\"type\":\"exchange limit\",\"timestamp\":\"1525119104\",\"timestampms\":1525119104623,\"is_live\":false,\"is_cancelled\":true,\"is_hidden\":false,\"was_forced\":false,\"executed_amount\":\"0\",\"remaining_amount\":\"0.2\",\"client_order_id\":\"1525119104568195\",\"options\":[\"maker-or-cancel\"],\"price\":\"9284.11\",\"original_amount\":\"0.2\"}\r\n```\r\n\r\nNow, from my understanding, the `BadStatusLine` error is Gemini responding with invalid http, so I don't expect ccxt can fix that.\r\n\r\nBut, from reporting the error standpoint, several issues stand out to me:\r\n1. The stack trace swallows the actual line the error occurred on. I'm guessing the error came from this line: https://github.com/ccxt/ccxt/blob/deb2fa2ba0ffb648e8fe46d1d0efda5fb1085ffb/python/ccxt/base/exchange.py#L351\r\nBut that information was lost due to (I'm guessing) a new exception being thrown instead of rethrowing the old exception.\r\n2. The error message is unfriendly. It writes a bunch of arguments joined with spaces and without explanations, so hard to see where each argument begins and what everything means -> it forces the user to look at the ccxt source code.\r\n3. The last argument in this exception is a response object -> my initial assumption was that this is the response from the server which triggered the error. This does not seem to be the case, though. Assuming my guess for issue 1 is correct, this is actually the http response for the previous request, which is very misleading, especially considering issue 2.\r\n4. I don't know if this one is possible, but specifically for the BadStatusLine exception, it would be very useful to see the raw text returned from the server.\r\n\r\n- OS: Ubuntu 16.04 LTS 64 Bits\r\n- Programming Language version:python 2.7\r\n- CCXT version: 1.12.174\r\n- Exchange: Gemini\r\n- Method: create_order\r\n"},"comment":{"url":"https://api.github.com/repos/ccxt/ccxt/issues/comments/385701723","html_url":"https://github.com/ccxt/ccxt/issues/2713#issuecomment-385701723","issue_url":"https://api.github.com/repos/ccxt/ccxt/issues/2713","id":385701723,"user":{"login":"frosty00","id":14319357,"avatar_url":"https://avatars0.githubusercontent.com/u/14319357?v=4","gravatar_id":"","url":"https://api.github.com/users/frosty00","html_url":"https://github.com/frosty00","followers_url":"https://api.github.com/users/frosty00/followers","following_url":"https://api.github.com/users/frosty00/following{/other_user}","gists_url":"https://api.github.com/users/frosty00/gists{/gist_id}","starred_url":"https://api.github.com/users/frosty00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frosty00/subscriptions","organizations_url":"https://api.github.com/users/frosty00/orgs","repos_url":"https://api.github.com/users/frosty00/repos","events_url":"https://api.github.com/users/frosty00/events{/privacy}","received_events_url":"https://api.github.com/users/frosty00/received_events","type":"User","site_admin":false},"created_at":"2018-05-01T15:35:26Z","updated_at":"2018-05-01T15:35:26Z","author_association":"CONTRIBUTOR","body":"Is you're version of `requests` working with other websites? ('Connection aborted.', BadStatusLine(\"''\",)) inherits from RequestsException"}}
{"actor":{"display_login":"frosty00"}}