Skip to content
Sharp

Reactive Streams · interview question

In the Reactive Streams API, what does the onError() method do?

Multiple choiceEasychapter-19-curatedpremiumreactive-streamspublisher-and-subscriber
Choose one answer
Answer and explanation

Correct answer

B. Notifies the Subscriber of an error during data emission

Why

The onError() method is used by the Publisher to notify the Subscriber that an error has occurred during data emission. This allows the Subscriber to handle the error appropriately.

Test yourself on Reactive Streams

A free test with instant, explained results. No account needed.

Start free test
All Reactive Streams questions →