Netflix/RxJava — pull request #1401 by samhendley (2014-07-02 19:14:05+00:00)
Title: OnError while emitting onNext value: object.toString

public OnNextValue(Object value) {
super("OnError while emitting onNext value: " + value);
this.value = value;
}
I know this is probably a helpful error message in some cases but this can be a really costly operation when an objects toString is an expensive call or contains alot of output. I don't think we should be printing this in any case but if so it should be on demand (overload of getMessage()) rather than eagerly.

In my case it is causing a toString of a large context object that is normally only used for debugging purposes which makes the exception logs hard to use and they are rolling over the log files very quickly.

There is an added danger that if there is a bug in the toString method it will cause inconsistent exception creation. If the object throws an exception while rendering a string it will actually end up not seeing the real exception.