Chapter 8: Handling Errors

  1. How is an error handled in Reactor?

Errors arise when either the publisher or the subscriber throws back an exception. Reactor intercepts the exception, builds an Error event, and then sends it to the subscriber. The subscriber must implement ErrorCallbackHandler to handle the error.

  1. Which operators allow us to configure error handling?
  • onErrorReturn
  • onErrorResume
  • onErrorMap
  1. What is the difference between onErrorResume and onErrorReturn?

The OnErrorReturn operator provides a fall-back value in the event of an error. On the other hand, the OnErrorResume operator provides a fall-back value stream instead of a single fall-back value.

  1. How can we generate a timely response for a Reactive Streams?

The timeout() ...

Get Hands-On Reactive Programming with Reactor now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.