Can I raise an error from a map function or do I need to use flatMap? The error should be reported to onError. In RxJava I can simply throw an exception. How can I do the following (pseudo-)code
observable.map( value -> {if (value.isIllegal) raiseError else return value.count})
Obviously it is possible using a flatMap, but I am looking for a map solution.