Closed
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