These are chat archives for ReactiveX/RxJava
RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.
onNextcalls into try-catches. In fact, it is discouraged in RxJava 2 because it can misdirect exceptions from bugs. If you have something that can throw inside your
onNext, wrap that into try-catch and don't let it escape. Btw, are you learning RxJava 2?
Functioncan throw so it is wrapped and managed.
onNextshould not throw as the specification mandates thus is not wrapped.
onNextshould return normally. If it throws, that's something the concrete implementation has to handle in some way. RxJava 2 doesn't capture such exceptions which then bubble in the current thread, eventually hitting an uncaught exception handler. RxJava 2 trusts the operator implementations, why don't you?
subscribecall will end up in the global error handler anyway. Also there is the
safeSubscribe()method that guards against the very nasty consumers.