Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-10-08 08:44:54 -0400
committerUwe Stieber2013-10-08 08:44:54 -0400
commitdacdbd7ab4a4eacce29dbf19cd4889c761b019f3 (patch)
treeeb2f51d5ebd1376888d9cd4772e71a705b2dc34c /target_explorer
parent362ea6895e88ac28362403df88f2557b2129867f (diff)
downloadorg.eclipse.tcf-dacdbd7ab4a4eacce29dbf19cd4889c761b019f3.tar.gz
org.eclipse.tcf-dacdbd7ab4a4eacce29dbf19cd4889c761b019f3.tar.xz
org.eclipse.tcf-dacdbd7ab4a4eacce29dbf19cd4889c761b019f3.zip
Target Explorer: Unwrap TCF error reports in StatusHelper
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/utils/StatusHelper.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/utils/StatusHelper.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/utils/StatusHelper.java
index b8aa731f1..927f90b25 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/utils/StatusHelper.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime/src/org/eclipse/tcf/te/runtime/utils/StatusHelper.java
@@ -40,6 +40,23 @@ public final class StatusHelper {
String message = error.getLocalizedMessage();
if (message == null) message = error.getMessage();
+ message = unwrapErrorReport(message);
+
return new Status(severity, CoreBundleActivator.getUniqueIdentifier(), message != null ? message : error.toString(), error);
}
+
+ /**
+ * Unwrap a "TCF Error Report:" error text.
+ *
+ * @param error The error text or <code>null</code>.
+ * @return The unwrapped error text or the unmodified input parameter.
+ */
+ public static final String unwrapErrorReport(String error) {
+ // Unwrap "TCF error report" errors
+ if (error != null && error.startsWith("TCF error report")) { //$NON-NLS-1$
+ error = error.substring(error.indexOf("Error text:") + 11, error.indexOf("Error code:")); //$NON-NLS-1$ //$NON-NLS-2$
+ error = error.trim();
+ }
+ return error;
+ }
}

Back to the top