Skip to content

Commit

Permalink
Switches to new ServerConnectionException.
Browse files Browse the repository at this point in the history
Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
  • Loading branch information
spericas committed Aug 30, 2024
1 parent 9e3cd89 commit 0364317
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.charset.StandardCharsets;
import java.util.Optional;

Expand All @@ -37,6 +36,7 @@
import io.helidon.http.media.MediaContext;
import io.helidon.http.sse.SseEvent;
import io.helidon.webserver.ConnectionContext;
import io.helidon.webserver.ServerConnectionException;
import io.helidon.webserver.http.ServerResponse;
import io.helidon.webserver.http.spi.Sink;
import io.helidon.webserver.http.spi.SinkProviderContext;
Expand Down Expand Up @@ -174,7 +174,8 @@ private byte[] serializeData(Object object, MediaType mediaType) {
}
return baos.toByteArray();
} catch (IOException e) {
throw new UncheckedIOException(e);
throw new ServerConnectionException("Failed to write SSE event", e);

}
}
throw new IllegalStateException("Unable to serialize SSE event without a media context");
Expand Down

0 comments on commit 0364317

Please sign in to comment.