Generating errors

Before we try to handle errors, let's first try to raise a few. In Java ecosystems, error conditions are raised by throwing exceptions. Exceptions can be raised under the following conditions:

  • The producer can throw an exception while generating the next value.
  • The subscriber can throw an exception while processing the next value or subscription event, or in any operators.

In all of the preceding conditions, there must be an effective procedure for handling the error raised. Reactive Streams prescribe the error event for the same purpose. The specification states that a producer should raise an error event, instead of throwing an exception. However, the specification does not discuss exceptions raised while processing ...

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.