1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 11:55:40 +02:00

remove error mesg duplication.

This commit is contained in:
Alain Magloire 2003-07-10 19:23:29 +00:00
parent 2f2d91ff46
commit 2449709449

View file

@ -80,16 +80,23 @@ public abstract class Command
* throw an MIException.
*/
protected void throwMIException (MIInfo info, MIOutput out) throws MIException {
String mesg = info.getErrorMsg();
String mesg = info.getErrorMsg().trim();
StringBuffer sb = new StringBuffer();
MIOOBRecord[] oobs = out.getMIOOBRecords();
for (int i = 0; i < oobs.length; i++) {
if (oobs[i] instanceof MILogStreamOutput) {
MIStreamRecord o = (MIStreamRecord) oobs[i];
sb.append(o.getString());
String s = o.getString();
if (!s.trim().equalsIgnoreCase(mesg)) {
sb.append(s);
}
}
}
throw new MIException(mesg, sb.toString());
String details = sb.toString();
if (details.trim().length() == 0) {
details = mesg;
}
throw new MIException(mesg, details);
}
}