Merge pull request #995 from NicoNes/ISSUE-992
Clarify behavior when SseEvent source onEvent throws and exception
diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSource.java b/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSource.java
index bc5f06d..56bd284 100644
--- a/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSource.java
+++ b/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSource.java
@@ -72,6 +72,11 @@
* <p>
* In the case of an error condition response, the <code>Throwable</code> passed to the <code>onError</code> consumer
* <i>should</i> be a WebApplicationException containing the invalid <code>Response</code> object.
+ * <p>
+ * Note that if, for any of the registered event consumers, an invocation of {@link Consumer#accept(Object)
+ * Consumer<InboundSseEvent>#accept(InboundSseEvent)} method throws an exception, this is not an error condition.
+ * Thus <code>onError</code> is not invoked and event processing is not stopped.
+ * Users are encouraged to handle exceptions on their own as part of the event processing logic.
*
* @author Marek Potociar
* @since 2.1