It's a nit, but I'd like to see something like this:

Throwable cause = getCause();
if (cause != null) {
  sb.append("caused by: ");
  cause.printStackTrace(sb, nl);
}

It's a little more defensive, in case a class overrides getCause() such that it's backed by a mutable field that can be concurrently modified.