From c0866ebeae11360312f80049ea9af85c4b5242d7 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 7 Nov 2019 15:59:13 -0600 Subject: [PATCH] Issue #4269 - Restoring PrintWriter contract on errors Signed-off-by: Joakim Erdfelt --- .../main/java/org/eclipse/jetty/server/ResponseWriter.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ResponseWriter.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ResponseWriter.java index f2c6352e623..094f98f1cbc 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ResponseWriter.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ResponseWriter.java @@ -128,10 +128,13 @@ public class ResponseWriter extends PrintWriter private void isOpen() throws IOException { if (_ioException != null) - throw new RuntimeIOException(_ioException); + throw _ioException; if (_isClosed) - throw new EofException("Stream closed"); + { + _ioException = new EofException("Stream closed"); + throw _ioException; + } } @Override