{"action":"created","issue":{"url":"https://api.github.com/repos/benoitc/hackney/issues/191","labels_url":"https://api.github.com/repos/benoitc/hackney/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/benoitc/hackney/issues/191/comments","events_url":"https://api.github.com/repos/benoitc/hackney/issues/191/events","html_url":"https://github.com/benoitc/hackney/issues/191","id":84001894,"number":191,"title":"no case clause matching: {:error, :badarg}","user":{"login":"AntonFagerberg","id":1349615,"avatar_url":"https://avatars.githubusercontent.com/u/1349615?v=3","gravatar_id":"","url":"https://api.github.com/users/AntonFagerberg","html_url":"https://github.com/AntonFagerberg","followers_url":"https://api.github.com/users/AntonFagerberg/followers","following_url":"https://api.github.com/users/AntonFagerberg/following{/other_user}","gists_url":"https://api.github.com/users/AntonFagerberg/gists{/gist_id}","starred_url":"https://api.github.com/users/AntonFagerberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AntonFagerberg/subscriptions","organizations_url":"https://api.github.com/users/AntonFagerberg/orgs","repos_url":"https://api.github.com/users/AntonFagerberg/repos","events_url":"https://api.github.com/users/AntonFagerberg/events{/privacy}","received_events_url":"https://api.github.com/users/AntonFagerberg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/benoitc/hackney/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/benoitc/hackney/milestones/3","html_url":"https://github.com/benoitc/hackney/milestones/2.0.0","labels_url":"https://api.github.com/repos/benoitc/hackney/milestones/3/labels","id":1007411,"number":3,"title":"2.0.0","description":"next major release.\r\n\r\n- API improvements in transports\r\n- Improve keepalive\r\n- refactor client API\r\n- Use lager as logger\r\n\r\nwork happen there: \r\nhttps://github.com/benoitc/hackney/tree/hackney/hackney_socks","creator":{"login":"benoitc","id":14498,"avatar_url":"https://avatars.githubusercontent.com/u/14498?v=3","gravatar_id":"","url":"https://api.github.com/users/benoitc","html_url":"https://github.com/benoitc","followers_url":"https://api.github.com/users/benoitc/followers","following_url":"https://api.github.com/users/benoitc/following{/other_user}","gists_url":"https://api.github.com/users/benoitc/gists{/gist_id}","starred_url":"https://api.github.com/users/benoitc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benoitc/subscriptions","organizations_url":"https://api.github.com/users/benoitc/orgs","repos_url":"https://api.github.com/users/benoitc/repos","events_url":"https://api.github.com/users/benoitc/events{/privacy}","received_events_url":"https://api.github.com/users/benoitc/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":1,"state":"open","created_at":"2015-03-05T12:20:21Z","updated_at":"2015-06-29T04:24:19Z","due_on":"2015-07-01T22:00:00Z","closed_at":null},"comments":8,"created_at":"2015-06-02T12:32:16Z","updated_at":"2015-06-29T04:26:35Z","closed_at":null,"body":"I'm load testing a system I've built in Elixir which is using Hackney to send requests. The problem is that sometimes (yes, unfortunately sometimes) when I crank up the number of requests executed concurrently I get a matching error which seems to happen because of a missing case clause inside Hackney:\r\n\r\n```\r\n** (exit) an exception was raised:\r\n    ** (CaseClauseError) no case clause matching: {:error, :badarg}\r\n        (hackney) src/hackney_client/hackney_response.erl:74: :hackney_response.wait_status/1\r\n        (hackney) src/hackney_client/hackney.erl:357: :hackney.send_request/2\r\n```\r\n\r\nI'm afraid I don't have any code in which I can replicate this issue, but please tell me if there is any additional information I can provide.\r\n\r\nHere's the Hackney code which seems to fail: https://github.com/benoitc/hackney/blob/master/src/hackney_client/hackney_response.erl#L74"},"comment":{"url":"https://api.github.com/repos/benoitc/hackney/issues/comments/116429862","html_url":"https://github.com/benoitc/hackney/issues/191#issuecomment-116429862","issue_url":"https://api.github.com/repos/benoitc/hackney/issues/191","id":116429862,"user":{"login":"unitymind","id":688698,"avatar_url":"https://avatars.githubusercontent.com/u/688698?v=3","gravatar_id":"","url":"https://api.github.com/users/unitymind","html_url":"https://github.com/unitymind","followers_url":"https://api.github.com/users/unitymind/followers","following_url":"https://api.github.com/users/unitymind/following{/other_user}","gists_url":"https://api.github.com/users/unitymind/gists{/gist_id}","starred_url":"https://api.github.com/users/unitymind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unitymind/subscriptions","organizations_url":"https://api.github.com/users/unitymind/orgs","repos_url":"https://api.github.com/users/unitymind/repos","events_url":"https://api.github.com/users/unitymind/events{/privacy}","received_events_url":"https://api.github.com/users/unitymind/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T04:26:35Z","updated_at":"2015-06-29T04:26:35Z","body":"Currently I am use workaround:\r\n\r\n```\r\ntry do\r\n...\r\nrescue\r\n  e in CaseClauseError ->\r\n    case e do\r\n      %CaseClauseError{ term: { :error, :bad_request } } ->\r\n        check_base_url(url |> String.replace(\"http://\", \"https://\"))\r\n    end\r\nend\r\n\r\nrecursive call with schema changing. \r\n\r\nThink so the most non-destructive solution is return { :error, %HTTPoison.Error {} }\r\n    "}}