code: private static void printStackTraceCause(Throwable nested, Locale locale, Appendable buffer) throws IOException {
  
      if (nested instanceof NlsThrowable) {
        ((NlsThrowable) nested).printStackTrace(locale, buffer);
      } else {
        for (StackTraceElement element : nested.getStackTrace()) {
          buffer.append("\tat ");
          buffer.append(element.toString());
          buffer.append('\n');
        }
        Throwable cause = nested.getCause();
        if (cause != null) {
          buffer.append("Caused by: ");
          buffer.append('\n');
          printStackTraceCause(cause, locale, buffer);
        }
      }
    }
docs: @see NlsThrowable#printStackTrace(Locale, Appendable)
  
  @param nested is the {@link Throwable} to print.
  @param locale is the {@link Locale} to translate to.
  @param buffer is where to write the stack trace to.
  @throws IOException if caused by {@code buffer}.