Methods Summary |
---|
public void | addContext(java.lang.String str)Adds a line of context to this instance.
if (str == null) {
throw new NullPointerException("str == null");
}
context.append(str);
if (!str.endsWith("\n")) {
context.append('\n");
}
|
public java.lang.String | getContext()Gets the context.
return context.toString();
|
public void | printContext(java.io.PrintWriter out)Prints the message and context.
out.println(getMessage());
out.print(context);
|
public void | printContext(java.io.PrintStream out)Prints the message and context.
out.println(getMessage());
out.print(context);
|
public void | printStackTrace(java.io.PrintStream out){@inheritDoc}
super.printStackTrace(out);
out.println(context);
|
public void | printStackTrace(java.io.PrintWriter out){@inheritDoc}
super.printStackTrace(out);
out.println(context);
|
public static com.android.dexgen.util.ExceptionWithContext | withContext(java.lang.Throwable ex, java.lang.String str)Augments the given exception with the given context, and return the
result. The result is either the given exception if it was an
{@link ExceptionWithContext}, or a newly-constructed exception if it
was not.
ExceptionWithContext ewc;
if (ex instanceof ExceptionWithContext) {
ewc = (ExceptionWithContext) ex;
} else {
ewc = new ExceptionWithContext(ex);
}
ewc.addContext(str);
return ewc;
|