title: onErrorResume not working as expected
body: <p>I'm trying to use WebFlux and I'm seeing a behavior I don't quite understand, I suspect this is a bug in WebFlux or possibly Reactor, but I need confirmation. </p>
  
  <p>I've attempted to create a minimally reproducible case that consist of a <strong>very</strong> simple HandlerFunction that attempts to return an 200 response, but throws an exception during body creation and then attempts to use onErrorResume to instead return a 404 response. </p>
  
  <p>The handler looks like so:</p>
  
  <pre><code>public Mono&lt;ServerResponse&gt; reproduce(ServerRequest request){
          return ServerResponse.ok()
          .contentType(APPLICATION_JSON)
          .body(Mono.fromCallable(this::trigger),String.class)
          .onErrorResume(MinimalExampleException.class,e-&gt;ServerResponse.notFound().build());
  }
  </code></pre>
  
  <p>I would expect when calling the associated endpoint that I would get a 404 response. Instead what I'm seeing is a 500 response with log messages indicating Spring believes there was an unhandled exception during request processing.</p>
  
  <p>When I breakpoint inside of onErrorResume I see two handlers being registered, the one I register in the method above, as well as one that's being registered by Spring (inside of <code>RouterFunctions.toHttpHandler</code>) for instances of <code>ResponseStatusException</code>. Then during processing of the request I see only the second handler (the one registered by Spring) being called, not matching on the exception being thrown and then falling through to the root level handler.</p>
  
  <p>Near as I can tell, Spring is overwriting onErrorResume at the router level preventing the one I registered in the Handler from being called. Is this the expected behavior? Is there a better way to accomplish what I'm attempting?</p>