aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/ThreadGroup.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/lang/ThreadGroup.java')
-rw-r--r--libjava/java/lang/ThreadGroup.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/libjava/java/lang/ThreadGroup.java b/libjava/java/lang/ThreadGroup.java
index e8b4446..bdf37f9 100644
--- a/libjava/java/lang/ThreadGroup.java
+++ b/libjava/java/lang/ThreadGroup.java
@@ -511,7 +511,19 @@ public class ThreadGroup
{
if (thread != null)
System.out.print("Exception in thread \"" + thread.getName() + "\" ");
- t.printStackTrace();
+ try
+ {
+ t.printStackTrace();
+ }
+ catch (Throwable x)
+ {
+ // This means that something is badly screwed up with the runtime,
+ // or perhaps someone is messing with the SecurityManager. In any
+ // case, try to deal with it gracefully.
+ System.out.println(t);
+ System.err.println("*** Got " + x.toString() +
+ " while trying to print stack trace");
+ }
had_uncaught_exception = true;
}
}