From 85a3ce52f594d995fc2675098be064bf7ef3a563 Mon Sep 17 00:00:00 2001 From: slewis Date: Tue, 15 Apr 2014 15:31:18 -0700 Subject: Fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=432868 Change-Id: I7658f51df8912540ade85bcdef6abe60ab6b05fd --- .../org/eclipse/ecf/core/util/ECFException.java | 8 ++++---- .../eclipse/ecf/core/util/ECFRuntimeException.java | 23 ++++++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFException.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFException.java index 74550a2b4..89f0acce0 100644 --- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFException.java +++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFException.java @@ -8,9 +8,7 @@ ******************************************************************************/ package org.eclipse.ecf.core.util; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.*; import org.eclipse.ecf.internal.core.identity.Activator; public class ECFException extends CoreException { @@ -41,7 +39,8 @@ public class ECFException extends CoreException { * @param cause */ public ECFException(String message, Throwable cause) { - this(new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, ((message == null) ? "" : message), cause)); //$NON-NLS-1$ + this(new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, + ((message == null) ? "" : message), cause)); //$NON-NLS-1$ } /** @@ -50,5 +49,6 @@ public class ECFException extends CoreException { */ public ECFException(IStatus status) { super(status); + initCause(status.getException()); } } \ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFRuntimeException.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFRuntimeException.java index d96550d1d..6ef0a7e6d 100644 --- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFRuntimeException.java +++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/ECFRuntimeException.java @@ -49,29 +49,32 @@ public class ECFRuntimeException extends RuntimeException { * @param cause */ public ECFRuntimeException(String message, Throwable cause) { - this(new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, ((message == null) ? "" : message), cause)); //$NON-NLS-1$ + this(new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, + ((message == null) ? "" : message), cause)); //$NON-NLS-1$ } /** - * Creates a new exception with the given status object. The message - * of the given status is used as the exception message. + * Creates a new exception with the given status object. The message of the + * given status is used as the exception message. * - * @param status the status object to be associated with this exception + * @param status + * the status object to be associated with this exception */ public ECFRuntimeException(IStatus status) { super(status.getMessage()); + initCause(status.getException()); this.status = status; } /** * Returns the status object for this exception. *

- * IMPORTANT:
- * The result must NOT be used to log a CoreException - * (e.g., using yourPlugin.getLog().log(status);), - * since that code pattern hides the original stacktrace. - * Instead, create a new {@link Status} with your plug-in ID and - * this CoreException, and log that new status. + * IMPORTANT:
+ * The result must NOT be used to log a CoreException (e.g., + * using yourPlugin.getLog().log(status);), since that code + * pattern hides the original stacktrace. Instead, create a new + * {@link Status} with your plug-in ID and this CoreException, + * and log that new status. *

* * @return a status object -- cgit v1.2.3