Skip to content

HystrixCommand ignoreExceptions not working as expected for Observables Javanica #1272

Closed
@smjdowling

Description

    @HystrixCommand(ignoreExceptions = IllegalArgumentException.class)
    public Observable<User> getUserById(final String id) {
        return Observable.create(new Observable.OnSubscribe<User>() {
                @Override
                public void call(Subscriber<? super User> observer) {
                    try {
                        if (!observer.isUnsubscribed()) {
                            observer.onNext(new User(id, name + id)); //throws IllegalArgumentException
                            observer.onCompleted();
                        }
                    } catch (Exception e) {
                        observer.onError(e);
                    }
                }
            });
    }

When an IllegalArgumentException is thrown then the Observable has HystrixRuntimeException with IllegalArgumentException wrapped. It should have HystrixBadRequestException with IllegalArgumentException wrapped.

https://cloud.githubusercontent.com/assets/1413873/4875441/0daa6986-6297-11e4-987a-f43ad47ed0b2.png

Activity

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

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions