title: How could we use @ExceptionHandler with spring web flux?
body: <p>In spring web we could use annotation @ExceptionHandler for handling server and client errors for controllers.</p>
  
  <p>I've tried to use this annotation with web-flux controller and it still worked for me, but after some investigation I've found out <a href="http://www.sparkbit.pl/spring-web-reactive-rest-controllers/" rel="noreferrer">here</a></p>
  
  <blockquote>
    <p>The situation with Spring Web Reactive is more complicated. Because
    the reactive streams are evaluted by a different thread than the one
    that executes the controllers method, the exceptions won’t be
    propagated to the controller thread automatically. This means that the
    @ExceptionHandler method will work only for exceptions that are thrown
    in the thread that handles the request directly. Exceptions thrown in
    the stream will have to be propagated back to the thread if we want to
    use the @ExceptionHandler feature. This seems like a bit of a let down
    but at the time of writing this Spring 5 is still not released so
    error handling might still get better.</p>
  </blockquote>
  
  <p>So my question is how to propagate back exception to the thread. Is there a good example or article about using @ExceptionHandler and Spring web flux?</p>
  
  <p>Updated:
  From <a href="https://docs.spring.io/spring-boot/docs/2.0.0.M6/reference/html/boot-features-developing-web-applications.html#boot-features-webflux-error-handling" rel="noreferrer">spring.io</a> it looks like it's supported, but still lack general understanding</p>
  
  <p>Thanks,</p>