From d825ba729bc1b90a67ae1ab09bf5b21c3a2b16bf Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Thu, 18 Jun 2009 03:27:50 +0000 Subject: [PATCH] 280707 client.HttpConnection does not catch and handle non-IOExceptions git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@421 7e9141cc-0065-0410-87d8-b60c137991c4 --- VERSION.txt | 1 + .../eclipse/jetty/client/HttpConnection.java | 20 +++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index aa8fd4231f9..3da5b233813 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -12,6 +12,7 @@ jetty-7.0.0.M3-SNAPSHOT + 279725 Support 100 and 102 expectations + Refactored AbstractBuffers to HttpBuffers for performance + Numerous cleanups from static code analysis + + 280707 client.HttpConnection does not catch and handle non-IOExceptions jetty-7.0.0.M2 18 May 2009 + JETTY-937 Work around Sun JVM bugs diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java index 5555ff2e501..ac093923729 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java @@ -285,8 +285,11 @@ public class HttpConnection implements Connection return; } } - catch (IOException e) - { + catch (Throwable e) + { + if (e instanceof ThreadDeath) + throw (ThreadDeath)e; + synchronized (this) { if (_exchange != null) @@ -295,9 +298,18 @@ public class HttpConnection implements Connection _exchange.setStatus(HttpExchange.STATUS_EXCEPTED); } } - failed = true; Log.warn("IOE on "+_exchange); - throw e; + failed = true; + if (e instanceof IOException) + throw (IOException)e; + + if (e instanceof Error) + throw (Error)e; + + if (e instanceof RuntimeException) + throw (RuntimeException)e; + + throw new RuntimeException(e); } finally {