From 519aa42cff336a34041df665c4c7e8f738274973 Mon Sep 17 00:00:00 2001 From: wisberg Date: Wed, 12 Mar 2003 23:04:25 +0000 Subject: [PATCH] better rendering of exceptions thrown (including those from previously-unrendered FAIL messages) --- .../src/org/aspectj/tools/ajc/Main.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java b/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java index 63adce1dd..99ead011c 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/tools/ajc/Main.java @@ -245,7 +245,7 @@ public class Main { } } } catch (Throwable t) { - fail(holder, "thrown?", t); + fail(holder, "unexpected exception", t); } } @@ -405,16 +405,12 @@ public class Main { */ protected String render(IMessage message) { IMessage.Kind kind = message.getKind(); - if (kind.equals(IMessage.ABORT)) { - Throwable t = message.getThrown(); - if (null == t) { - return "abort (no message)"; - } else { - return Main.renderExceptionForUser(t); - } - } + StringBuffer sb = new StringBuffer(); String text = message.getMessage(); + if (text.equals(AbortException.NO_MESSAGE_TEXT)) { + text = null; + } boolean toString = (LangUtil.isEmpty(text)); if (toString) { text = message.toString(); @@ -442,6 +438,12 @@ public class Main { sb.append(LangUtil.EOL); sb.append(context); } + Throwable thrown = message.getThrown(); + if (null != thrown) { + sb.append(LangUtil.EOL); + sb.append(Main.renderExceptionForUser(thrown)); + } + return sb.toString(); } -- 2.39.5