Author: adietish
Date: 2011-01-28 11:36:24 -0500 (Fri, 28 Jan 2011)
New Revision: 28706
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ErrorUtils.java
Log:
[JBIDE-8249] not checking for platform debug status any more & wrapping throwable into
multistatus so that we log message, too
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ErrorUtils.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ErrorUtils.java 2011-01-28
16:35:07 UTC (rev 28705)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/ErrorUtils.java 2011-01-28
16:36:24 UTC (rev 28706)
@@ -25,15 +25,15 @@
public class ErrorUtils {
public static IStatus handleError(final String title, final String message, Throwable e,
final Shell shell) {
IStatus status = createStatus(e);
+ log(message, status);
openErrorDialog(title, message, status, shell);
- log(status);
return status;
}
- private static void log(IStatus status) {
- if (Activator.getDefault().isDebugging()) {
- Activator.log(status);
- }
+ private static void log(String message, IStatus status) {
+ // need to wrap the status so that we log the message, too
+ IStatus wrapperStatus = StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
message, null, status);
+ Activator.log(wrapperStatus);
}
/**
@@ -45,15 +45,13 @@
* @param shell
* @return
*/
- public static IStatus handleErrorAsync(final String title, final String message, final
Throwable e,
+ public static void handleErrorAsync(final String title, final String message, final
Throwable e,
final Shell shell) {
- IStatus status = createStatus(e);
shell.getDisplay().asyncExec(new Runnable() {
public void run() {
handleError(title, message, e, shell);
}
});
- return status;
}
private static IStatus createStatus(Throwable e) {
@@ -65,11 +63,6 @@
}
private static void openErrorDialog(final String title, String message, final IStatus
status, final Shell shell) {
- // Display.getDefault().syncExec(new Runnable() {
- // public void run() {
- // ErrorDialog.openError(shell, title, status.getMessage(), status);
- // }
- // });
ErrorDialog.openError(shell, title, message, status);
}
Show replies by date