Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorafinkbein2008-11-21 20:59:13 +0000
committerafinkbein2008-11-21 20:59:13 +0000
commitef2e172edd959464bb230332c9191fcedd952793 (patch)
tree2d08a309e80e726488b9ce4328e60d160f65ab76 /org.eclipse.osee.framework.ui.skynet
parent9a242c98d0d7a5878ada480a348aff4cfeea425c (diff)
downloadorg.eclipse.osee-ef2e172edd959464bb230332c9191fcedd952793.tar.gz
org.eclipse.osee-ef2e172edd959464bb230332c9191fcedd952793.tar.xz
org.eclipse.osee-ef2e172edd959464bb230332c9191fcedd952793.zip
"Team Workflow" - T882T - "Error information when connecting to an ote test server with different *.jars is not being propagated to the user."
Diffstat (limited to 'org.eclipse.osee.framework.ui.skynet')
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/DialogPopupLoggerListener.java44
1 files changed, 33 insertions, 11 deletions
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/DialogPopupLoggerListener.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/DialogPopupLoggerListener.java
index 70e38e36b18..1a4d7efcddb 100644
--- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/DialogPopupLoggerListener.java
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/DialogPopupLoggerListener.java
@@ -5,8 +5,11 @@
*/
package org.eclipse.osee.framework.ui.skynet;
+import java.util.ArrayList;
+import java.util.List;
import java.util.logging.Level;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.osee.framework.logging.ILoggerListener;
@@ -18,27 +21,26 @@ import org.eclipse.swt.widgets.Display;
*/
public class DialogPopupLoggerListener implements ILoggerListener {
- public static final String SPLIT = "##split##";
-
/* (non-Javadoc)
* @see org.eclipse.osee.framework.logging.ILoggerListener#log(java.lang.String, java.lang.String, java.util.logging.Level, java.lang.String, java.lang.Throwable)
*/
@Override
public void log(String loggerName, Level level, String message, Throwable th) {
if (level == OseeLevel.SEVERE_POPUP) {
- String[] msgs = message.split(SPLIT);
String title = "OSEE Error";
String messageText = message;
String reasonMessage = "";
- if (msgs.length == 2) {
- title = msgs[0];
- messageText = msgs[1];
- } else if (msgs.length == 3) {
- title = msgs[0];
- messageText = msgs[1];
- reasonMessage = msgs[2];
+ if (th != null) {
+ reasonMessage = th.getMessage();
+ }
+ final IStatus status;
+ if (th != null) {
+ List<IStatus> exc = new ArrayList<IStatus>();
+ exceptionToString(true, loggerName, th, exc);
+ status = new MultiStatus(loggerName, Status.ERROR, exc.toArray(new IStatus[exc.size()]), reasonMessage, th);
+ } else {
+ status = new Status(Status.ERROR, loggerName, -20, reasonMessage, th);
}
- final IStatus status = new Status(Status.ERROR, loggerName, reasonMessage, th);
final String realTitle = title;
final String realMessageText = messageText;
Display.getDefault().syncExec(new Runnable() {
@@ -49,4 +51,24 @@ public class DialogPopupLoggerListener implements ILoggerListener {
});
}
}
+
+ private static void exceptionToString(boolean firstTime, String loggerName, Throwable ex, List<IStatus> exc) {
+ if (ex == null) {
+ return;
+ }
+ if (!firstTime) {
+ exc.add(new Status(Status.ERROR, loggerName, ex.getMessage()));
+ }
+ StackTraceElement st[] = ex.getStackTrace();
+ for (int i = 0; i < st.length; i++) {
+ StackTraceElement ste = st[i];
+ exc.add(new Status(Status.ERROR, loggerName, ste.toString()));
+ }
+ Throwable cause = ex.getCause();
+ if (cause != null) {
+ exc.add(new Status(Status.ERROR, loggerName, " caused by "));
+ exceptionToString(false, loggerName, cause, exc);
+ }
+ }
+
}

Back to the top