{"action":"created","issue":{"url":"https://api.github.com/repos/mark-5/p5-net-zookeeper/issues/4","labels_url":"https://api.github.com/repos/mark-5/p5-net-zookeeper/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/mark-5/p5-net-zookeeper/issues/4/comments","events_url":"https://api.github.com/repos/mark-5/p5-net-zookeeper/issues/4/events","html_url":"https://github.com/mark-5/p5-net-zookeeper/issues/4","id":75989633,"number":4,"title":"Can't get error messages when failing to create a Net::ZooKeeper client","user":{"login":"fgabolde","id":912215,"avatar_url":"https://avatars.githubusercontent.com/u/912215?v=3","gravatar_id":"","url":"https://api.github.com/users/fgabolde","html_url":"https://github.com/fgabolde","followers_url":"https://api.github.com/users/fgabolde/followers","following_url":"https://api.github.com/users/fgabolde/following{/other_user}","gists_url":"https://api.github.com/users/fgabolde/gists{/gist_id}","starred_url":"https://api.github.com/users/fgabolde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fgabolde/subscriptions","organizations_url":"https://api.github.com/users/fgabolde/orgs","repos_url":"https://api.github.com/users/fgabolde/repos","events_url":"https://api.github.com/users/fgabolde/events{/privacy}","received_events_url":"https://api.github.com/users/fgabolde/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-13T13:45:32Z","updated_at":"2015-05-14T00:10:33Z","closed_at":null,"body":"In case of error messages, we usually can do:\r\n\r\n    $zk->get_error;\r\n\r\nto get the error message (or at least an error code).\r\n\r\nBut if we fail to create $zk at all\r\n\r\n    my $zk = Net::ZooKeeper->new('obviously.not.going.to.work:999/whatever')\r\n      or die \"uh\";\r\n\r\nthere is no indication of how to get a useful error message."},"comment":{"url":"https://api.github.com/repos/mark-5/p5-net-zookeeper/issues/comments/101861339","html_url":"https://github.com/mark-5/p5-net-zookeeper/issues/4#issuecomment-101861339","issue_url":"https://api.github.com/repos/mark-5/p5-net-zookeeper/issues/4","id":101861339,"user":{"login":"mark-5","id":2516211,"avatar_url":"https://avatars.githubusercontent.com/u/2516211?v=3","gravatar_id":"","url":"https://api.github.com/users/mark-5","html_url":"https://github.com/mark-5","followers_url":"https://api.github.com/users/mark-5/followers","following_url":"https://api.github.com/users/mark-5/following{/other_user}","gists_url":"https://api.github.com/users/mark-5/gists{/gist_id}","starred_url":"https://api.github.com/users/mark-5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mark-5/subscriptions","organizations_url":"https://api.github.com/users/mark-5/orgs","repos_url":"https://api.github.com/users/mark-5/repos","events_url":"https://api.github.com/users/mark-5/events{/privacy}","received_events_url":"https://api.github.com/users/mark-5/received_events","type":"User","site_admin":false},"created_at":"2015-05-14T00:10:33Z","updated_at":"2015-05-14T00:10:33Z","body":"The error message from a failed connect gets stored in \"$!\". Unfortunately, the ZooKeeper C API that Net::ZooKeeper uses only reports errors from connect attempts by setting C's errno variable(which is accessible through perl using $!, as previously mentioned).\r\n\r\nI'd be happy to update the documentation to make this clearer."}}