{"action":"created","issue":{"url":"https://api.github.com/repos/Netflix/Hystrix/issues/1344","repository_url":"https://api.github.com/repos/Netflix/Hystrix","labels_url":"https://api.github.com/repos/Netflix/Hystrix/issues/1344/labels{/name}","comments_url":"https://api.github.com/repos/Netflix/Hystrix/issues/1344/comments","events_url":"https://api.github.com/repos/Netflix/Hystrix/issues/1344/events","html_url":"https://github.com/Netflix/Hystrix/issues/1344","id":174773857,"number":1344,"title":"Javanica: Option to send fallback exception to client instead of primary command","user":{"login":"nytins","id":8001559,"avatar_url":"https://avatars.githubusercontent.com/u/8001559?v=3","gravatar_id":"","url":"https://api.github.com/users/nytins","html_url":"https://github.com/nytins","followers_url":"https://api.github.com/users/nytins/followers","following_url":"https://api.github.com/users/nytins/following{/other_user}","gists_url":"https://api.github.com/users/nytins/gists{/gist_id}","starred_url":"https://api.github.com/users/nytins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nytins/subscriptions","organizations_url":"https://api.github.com/users/nytins/orgs","repos_url":"https://api.github.com/users/nytins/repos","events_url":"https://api.github.com/users/nytins/events{/privacy}","received_events_url":"https://api.github.com/users/nytins/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-09-02T14:32:36Z","updated_at":"2016-10-17T18:02:29Z","closed_at":null,"body":"We are having an issue because javanica always sends the primary command exception to the client.\r\n\r\n**Sample code**\r\n```\r\n@HystrixCommand(ignoreExceptions = {VallidationException.class}, fallbackMethod=\"getUserEmailsFallback\")\r\nList<String> getUserEmails(String userId) {\r\n  return callFirstService(userId);\r\n}\r\n\r\n@HystrixCommand(ignoreExceptions = {VallidationException.class})\r\nList<String> getUserEmailsFallback(String userId) {\r\n  return callSecondService(userId);\r\n}\r\n```\r\n**What is happening**\r\nIf the first service is down the first command throws `ConnectException` and falls back to fallback method.\r\nIf the fallback method throws `ValidationException` then the original `ConnectException` is thrown back to client.\r\n\r\nThis behaviour is undesired because its just a `ValidationException` and ideally we should be sending a message to client saying there is some validation exception.\r\n\r\n**What will make it better**\r\nIf fallback throws any of the ignored exceptions then propagate that exception to the client instead of the exception from the primary method."},"comment":{"url":"https://api.github.com/repos/Netflix/Hystrix/issues/comments/254284833","html_url":"https://github.com/Netflix/Hystrix/issues/1344#issuecomment-254284833","issue_url":"https://api.github.com/repos/Netflix/Hystrix/issues/1344","id":254284833,"user":{"login":"nytins","id":8001559,"avatar_url":"https://avatars.githubusercontent.com/u/8001559?v=3","gravatar_id":"","url":"https://api.github.com/users/nytins","html_url":"https://github.com/nytins","followers_url":"https://api.github.com/users/nytins/followers","following_url":"https://api.github.com/users/nytins/following{/other_user}","gists_url":"https://api.github.com/users/nytins/gists{/gist_id}","starred_url":"https://api.github.com/users/nytins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nytins/subscriptions","organizations_url":"https://api.github.com/users/nytins/orgs","repos_url":"https://api.github.com/users/nytins/repos","events_url":"https://api.github.com/users/nytins/events{/privacy}","received_events_url":"https://api.github.com/users/nytins/received_events","type":"User","site_admin":false},"created_at":"2016-10-17T18:02:29Z","updated_at":"2016-10-17T18:02:29Z","body":"@dmgcodevil I am also happy with this approach."}}
{"actor":{"display_login":"nytins"}}