Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2016-03-24 19:10:00 +0000
committerEugene Tarassov2016-03-24 19:10:00 +0000
commit1493eecba024497067d8061c1fda04dbb2a302a4 (patch)
treeb18e13d6a6d4e1c4e2d3d4acd8f2ce9c0bff5a74 /plugins
parent1a7bb0faea95f184478a7478b5701cf073c66971 (diff)
downloadorg.eclipse.tcf-1493eecba024497067d8061c1fda04dbb2a302a4.tar.gz
org.eclipse.tcf-1493eecba024497067d8061c1fda04dbb2a302a4.tar.xz
org.eclipse.tcf-1493eecba024497067d8061c1fda04dbb2a302a4.zip
TCF Core: better formatting of TCF error report text
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/Command.java34
-rw-r--r--plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/ErrorReport.java5
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFDebugTask.java4
3 files changed, 21 insertions, 22 deletions
diff --git a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/Command.java b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/Command.java
index c45876091..629f59c53 100644
--- a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/Command.java
+++ b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/Command.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2016 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -200,39 +200,39 @@ public abstract class Command implements IChannel.ICommandListener {
Number alt_code = (Number)map.get(IErrorReport.ERROR_ALT_CODE);
String alt_org = (String)map.get(IErrorReport.ERROR_ALT_ORG);
if (time != null) {
- bf.append('\n');
- bf.append("Time: ");
+ bf.append(" Time: ");
bf.append(timestamp_format.format(new Date(time.longValue())));
+ bf.append('\n');
}
if (severity != null) {
- bf.append('\n');
- bf.append("Severity: ");
+ bf.append(" Severity: ");
switch (severity.intValue()) {
case IErrorReport.SEVERITY_ERROR: bf.append("Error"); break;
case IErrorReport.SEVERITY_FATAL: bf.append("Fatal"); break;
case IErrorReport.SEVERITY_WARNING: bf.append("Warning"); break;
default: bf.append("Unknown"); break;
}
+ bf.append('\n');
}
- bf.append('\n');
- bf.append("Error text: ");
+ bf.append(" Error text: ");
bf.append(toErrorString(map));
bf.append('\n');
- bf.append("Error code: ");
+ bf.append(" Error code: ");
bf.append(code);
+ bf.append('\n');
if (service != null) {
- bf.append('\n');
- bf.append("Service: ");
+ bf.append(" Service: ");
bf.append(service);
+ bf.append('\n');
}
if (alt_code != null) {
- bf.append('\n');
- bf.append("Alt code: ");
+ bf.append(" Alt code: ");
bf.append(alt_code);
+ bf.append('\n');
if (alt_org != null) {
- bf.append('\n');
- bf.append("Alt org: ");
+ bf.append(" Alt org: ");
bf.append(alt_org);
+ bf.append('\n');
}
}
}
@@ -246,11 +246,11 @@ public abstract class Command implements IChannel.ICommandListener {
if (data == null) return null;
Map<String,Object> map = (Map<String,Object>)data;
StringBuffer bf = new StringBuffer();
- bf.append("TCF error report:");
- bf.append('\n');
+ bf.append("TCF error report:\n");
if (include_command_text) {
- bf.append("Command: ");
+ bf.append(" Command: ");
bf.append(getCommandString(0));
+ bf.append('\n');
}
appendErrorProps(bf, map);
return new ErrorReport(bf.toString(), map);
diff --git a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/ErrorReport.java b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/ErrorReport.java
index 86ff2d326..c4252b78d 100644
--- a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/ErrorReport.java
+++ b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/core/ErrorReport.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2016 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,8 +28,7 @@ public class ErrorReport extends Exception implements IErrorReport {
if (caused_by != null) {
Map<String,Object> map = (Map<String,Object>)caused_by;
StringBuffer bf = new StringBuffer();
- bf.append("TCF error report:");
- bf.append('\n');
+ bf.append("TCF error report:\n");
Command.appendErrorProps(bf, map);
initCause(new ErrorReport(bf.toString(), map));
}
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFDebugTask.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFDebugTask.java
index ce103d385..2083ac2b0 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFDebugTask.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFDebugTask.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2016 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -47,7 +47,7 @@ public abstract class TCFDebugTask<V> extends TCFTask<V> {
if (x instanceof DebugException) throw (DebugException)x;
if (x != null) throw new DebugException(new Status(
IStatus.ERROR, Activator.PLUGIN_ID, DebugException.REQUEST_FAILED,
- "Debugger request failed.\n " + x.getMessage(), x));
+ "Debugger request failed.\n" + x.getMessage(), x));
return getResult();
}

Back to the top