Cleaner error propagation in hystrix javanica #241

davidkarlsen opened this Issue Apr 12, 2014 · 5 comments


None yet

6 participants



"Based on this description, @HystrixCommand has an ability to specify exceptions types which should be ignored and wrapped to throw in HystrixBadRequestException.

@HystrixCommand(ignoreExceptions = {BadRequestException.class})
public User getUserById(String id) {
    return userResource.getUserById(id);

If userResource.getUserById(id); throws an exception which type is BadRequestException then this exception will be wrapped in HystrixBadRequestException and will not affect metrics and will not trigger fallback logic."

Wouldn't it be cleaner to unwrap the original exception and rethrow it, like I do in my prototype:

Because when adding hystrix as an AOP aspect I'd like not to alter the service signature/exceptions thrown. I like the idea that you can tell hystrix which exceptions to ignore as errors, but would like to get them thrown unwrapped, so hystrix is not change how exceptions should be catched by a client. Ideally hystrix should be invisible when throwing "business exceptions".


Hi, good point, thanks. I made PL with fix for this issue.


Could you guys update the javanica docs to reflect these changes (re-thrown exceptions are not actually wrapped in HystrixBadRequestException)?


Yes the docs should be updated accordingly 'cuz I was almost fooled..

Netflix, Inc. member

Is this PR clear? #1081

/cc @bryant-pham @brazeel @dmgcodevil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment