From 184aa8866059c921736efac5bb989ac17602ee09 Mon Sep 17 00:00:00 2001 From: samskivert Date: Tue, 11 Nov 2008 00:34:38 +0000 Subject: [PATCH] If a looping thread does terminate due to a runtime exception, log it on the way out rather than letting it propagate up to the JVM where it'll get written to stderr which isn't always useful. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2475 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/LoopingThread.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/java/com/samskivert/util/LoopingThread.java b/src/java/com/samskivert/util/LoopingThread.java index 95a3f963..cfdc276c 100644 --- a/src/java/com/samskivert/util/LoopingThread.java +++ b/src/java/com/samskivert/util/LoopingThread.java @@ -80,6 +80,9 @@ public class LoopingThread extends Thread } } + } catch (Throwable t) { + log.warning("Looping thread terminated with exception.", "thread", this, t); + } finally { // Running needs to be false even if this exited due to a Throwable from iterate _running = false;