diff --git a/examples/src/main/java/jaxrs/examples/sse/ServerSentEventsResource.java b/examples/src/main/java/jaxrs/examples/sse/ServerSentEventsResource.java index df4ab7bfb..98b1e4ff7 100644 --- a/examples/src/main/java/jaxrs/examples/sse/ServerSentEventsResource.java +++ b/examples/src/main/java/jaxrs/examples/sse/ServerSentEventsResource.java @@ -99,6 +99,8 @@ public void startDomain(@PathParam("id") final String id, eventSink.close(); } catch (final InterruptedException e) { e.printStackTrace(); + } catch (IOException ioe) { + //handle io error } }); } diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSink.java b/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSink.java index bf37ce372..e27b1630d 100644 --- a/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSink.java +++ b/jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSink.java @@ -16,6 +16,7 @@ package jakarta.ws.rs.sse; +import java.io.IOException; import java.util.concurrent.CompletionStage; /** @@ -71,7 +72,9 @@ public interface SseEventSink extends AutoCloseable { *

* Subsequent calls have no effect and are ignored. Once the {@link SseEventSink} is closed, invoking any method other * than this one and {@link #isClosed()} would result in an {@link IllegalStateException} being thrown. + * + * @exception IOException if an I/O error occurs. */ @Override - void close(); + void close() throws IOException; }