Catching Throwable instead of Exception.

This commit is contained in:
Simone Bordet 2014-08-08 18:16:56 +02:00
parent 5da39140df
commit 3ace246cff
6 changed files with 7 additions and 8 deletions

View File

@ -174,7 +174,7 @@ public class HttpContent implements Callback, Closeable
if (iterator instanceof Closeable) if (iterator instanceof Closeable)
((Closeable)iterator).close(); ((Closeable)iterator).close();
} }
catch (Exception x) catch (Throwable x)
{ {
LOG.ignore(x); LOG.ignore(x);
} }

View File

@ -489,7 +489,7 @@ public class HttpRequest implements Request
listener.onContent(response, content); listener.onContent(response, content);
callback.succeeded(); callback.succeeded();
} }
catch (Exception x) catch (Throwable x)
{ {
callback.failed(x); callback.failed(x);
} }

View File

@ -643,8 +643,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
content.succeeded(); content.succeeded();
process(); process();
} }
// Catch-all for runtime exceptions catch (Throwable x)
catch (Exception x)
{ {
anyToFailure(x); anyToFailure(x);
} }

View File

@ -238,7 +238,7 @@ public interface Response
onContent(response, content); onContent(response, content);
callback.succeeded(); callback.succeeded();
} }
catch (Exception x) catch (Throwable x)
{ {
callback.failed(x); callback.failed(x);
} }

View File

@ -180,7 +180,7 @@ public class HttpSenderOverHTTP extends HttpSender
} }
} }
} }
catch (Exception x) catch (Throwable x)
{ {
if (LOG.isDebugEnabled()) if (LOG.isDebugEnabled())
LOG.debug(x); LOG.debug(x);

View File

@ -131,7 +131,7 @@ public class PathContentProvider extends AbstractTypedContentProvider
close(); close();
throw x; throw x;
} }
catch (Exception x) catch (Throwable x)
{ {
close(); close();
throw (NoSuchElementException)new NoSuchElementException().initCause(x); throw (NoSuchElementException)new NoSuchElementException().initCause(x);
@ -152,7 +152,7 @@ public class PathContentProvider extends AbstractTypedContentProvider
if (channel != null) if (channel != null)
channel.close(); channel.close();
} }
catch (Exception x) catch (Throwable x)
{ {
LOG.ignore(x); LOG.ignore(x);
} }