diff options
author | Raphael Moll <ralf@android.com> | 2010-12-06 20:32:05 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2010-12-07 15:28:29 -0800 |
commit | 7e73e748de2f65ce418c0ede4f649fb6eba81ae0 (patch) | |
tree | 1e1fa612327c8cc9011c5eddd8ff3df45377ed3d /eclipse/plugins | |
parent | 7139790c9af02de824c6f2dae7a68ff694ae1f19 (diff) | |
download | sdk-7e73e748de2f65ce418c0ede4f649fb6eba81ae0.zip sdk-7e73e748de2f65ce418c0ede4f649fb6eba81ae0.tar.gz sdk-7e73e748de2f65ce418c0ede4f649fb6eba81ae0.tar.bz2 |
Cherry-pick 0ec90f2b from tools_r8
Display output error in the exception's toString..
Change-Id: Idce557d2c172d27abaf474d14136f48d7c3396dc
Diffstat (limited to 'eclipse/plugins')
2 files changed, 30 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ExecResultException.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ExecResultException.java index 37ab581..63a7a69 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ExecResultException.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ExecResultException.java @@ -44,4 +44,29 @@ class ExecResultException extends Exception { public int getErrorCode() { return mErrorCode; } + + public String getLabel() { + return "Command-line"; + } + + @Override + public String toString() { + String result = String.format("%1$s Error %2$d", getLabel(), mErrorCode); + if (mOutput != null && mOutput.length > 0) { + // Note : the "error detail" window in Eclipse seem to ignore the \n, + // so we prefix them with a space. It's not optimal but it's slightly readable. + result += " \nOutput:"; + for (String o : mOutput) { + if (o != null) { + result += " \n" + o; + } + } + } + return result; + } + + @Override + public String getMessage() { + return toString(); + } } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ProguardResultException.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ProguardResultException.java index bfc7e8b..54246b3 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ProguardResultException.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ProguardResultException.java @@ -26,4 +26,9 @@ public final class ProguardResultException extends ExecResultException { ProguardResultException(int errorCode, String[] output) { super(errorCode, output); } + + @Override + public String getLabel() { + return "Proguard"; + } } |