{"action":"created","issue":{"url":"https://api.github.com/repos/sksamuel/elastic4s/issues/328","labels_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/328/labels{/name}","comments_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/328/comments","events_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/328/events","html_url":"https://github.com/sksamuel/elastic4s/issues/328","id":87983172,"number":328,"title":"Error handling in elastic4s","user":{"login":"sdiwu","id":8465087,"avatar_url":"https://avatars.githubusercontent.com/u/8465087?v=3","gravatar_id":"","url":"https://api.github.com/users/sdiwu","html_url":"https://github.com/sdiwu","followers_url":"https://api.github.com/users/sdiwu/followers","following_url":"https://api.github.com/users/sdiwu/following{/other_user}","gists_url":"https://api.github.com/users/sdiwu/gists{/gist_id}","starred_url":"https://api.github.com/users/sdiwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdiwu/subscriptions","organizations_url":"https://api.github.com/users/sdiwu/orgs","repos_url":"https://api.github.com/users/sdiwu/repos","events_url":"https://api.github.com/users/sdiwu/events{/privacy}","received_events_url":"https://api.github.com/users/sdiwu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-13T10:50:59Z","updated_at":"2015-06-13T11:53:14Z","closed_at":null,"body":"I did a test like this when elastic server is not running:\r\n\r\n```\r\n        client.execute(index into \"bands/artists\" fields \"name\" -> \"coldplay\" id 11) map { resp =>\r\n          println(\"isCreated: \" + resp.isCreated)\r\n        } recover {\r\n          case e => println(\"Error happened: \" + e.getMessage)\r\n        }\r\n```\r\n\r\nSurprisely no exception happened at all and no text printed out at all. I thought it would fall into `recover` part, and it didn't fall into `map` part too. So the client just silently returns without error.\r\n\r\nIs there something I missed here? What is the correct way to handle error or failure in elastic4s?\r\n"},"comment":{"url":"https://api.github.com/repos/sksamuel/elastic4s/issues/comments/111702026","html_url":"https://github.com/sksamuel/elastic4s/issues/328#issuecomment-111702026","issue_url":"https://api.github.com/repos/sksamuel/elastic4s/issues/328","id":111702026,"user":{"login":"sksamuel","id":743706,"avatar_url":"https://avatars.githubusercontent.com/u/743706?v=3","gravatar_id":"","url":"https://api.github.com/users/sksamuel","html_url":"https://github.com/sksamuel","followers_url":"https://api.github.com/users/sksamuel/followers","following_url":"https://api.github.com/users/sksamuel/following{/other_user}","gists_url":"https://api.github.com/users/sksamuel/gists{/gist_id}","starred_url":"https://api.github.com/users/sksamuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sksamuel/subscriptions","organizations_url":"https://api.github.com/users/sksamuel/orgs","repos_url":"https://api.github.com/users/sksamuel/repos","events_url":"https://api.github.com/users/sksamuel/events{/privacy}","received_events_url":"https://api.github.com/users/sksamuel/received_events","type":"User","site_admin":false},"created_at":"2015-06-13T11:53:13Z","updated_at":"2015-06-13T11:53:13Z","body":"If you look at the source for ElasticClient you can see what its doing.\nIt's just creating a local d\n\nOn 13 June 2015 at 12:51, Suyandi <notifications@github.com> wrote:\n\n> Ok, I found out that if using ElasticClient.local, it will not throw any\n> exception, but using ElasticClient.remote will throw exception.\n>\n> I'm curious, what's the equivalent of ElasticClient.local in the Java\n> API:\n> https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/client.html\n> ?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/sksamuel/elastic4s/issues/328#issuecomment-111701977>.\n>\n"}}