How to handle error while executing Flux.map()
<p>I´m trying to figure out how handle errors when mapping elements inside a Flux.</p>

<p>For instance, I´m parsing a CSV string into one of my business POJOs:</p>

<pre><code>myflux.map(stock -&gt; converter.convertHistoricalCSVToStockQuotation(stock));
</code></pre>

<p>Some of this lines might contain errors, so what I get in the log is:</p>

<pre><code> reactor.core.publisher.FluxLog:  onNext([SOME_BOGUS_QUOTE]@38.09 (Fri Apr 08 00:00:00 CEST 2016) H(38.419998)/L(37.849998)/O(37.970001))
 reactor.core.publisher.FluxLog:  onNext([SOME_BOGUS_QUOTE]@38.130001 (Thu Apr 07 00:00:00 CEST 2016) H(38.189999)/L(37.610001)/O(37.799999))
 reactor.core.publisher.FluxLog:  onError(java.lang.IllegalArgumentException: Invalid CSV stock quotation: SOME_BOGUS_QUOTE,trololo)
 reactor.core.publisher.FluxLog:  java.lang.IllegalArgumentException: Invalid CSV stock quotation: SOME_BOGUS_QUOTE,trololo
</code></pre>

<p>I read in the API some error handling methods, but most refered to returning an "error value" or using a fallback Flux, like this one:</p>

<pre><code>Flux.onErrorResumeWith(myflux, x -&gt; Mono.fromCallable(() -&gt; ... do stuff);
</code></pre>

<p>However, using this with my <code>myflux</code> means that the whole flux is processed again.</p>

<p>So, is there a way to handle errors while processing particular elements (I.e ignoring them/Logging them) and keep processing the rest of the flux?</p>

<p><strong>UPDATE with @akarnokd workaround</strong></p>

<pre><code>public Flux&lt;StockQuotation&gt; getQuotes(List&lt;String&gt; tickers)
{
    Flux&lt;StockQuotation&gt; processingFlux = Flux.fromIterable(tickers)
    // Get each set of quotes in a separate thread
    .flatMap(s -&gt; Mono.fromCallable(() -&gt; feeder.getCSVQuotes(s)))
    // Convert each list of raw quotes string in a new Flux&lt;String&gt;
    .flatMap(list -&gt; Flux.fromIterable(list))
    // Convert the string to POJOs
    .flatMap(x -&gt; {
            try {
                return Flux.just(converter.convertHistoricalCSVToStockQuotation(x));    
            }
            catch (IllegalArgumentException ex){
                System.out.println("Error decoding stock quotation: " + x);
                return Flux.empty();
            }
    });

    return processingFlux;
}
</code></pre>

<p>This works as a charm, however, as you can see the code is less elegant than before. Does not the Flux API have any method to do what this code does?</p>

<pre><code>retry(...)
retryWhen(...)
onErrorResumeWith(...)
onErrorReturn(...)
</code></pre>