code: public void printThrowable(Throwable t) {
          final PrintContext context = new PrintContext();
  
          Throwable prevThrowable = null;
          Throwable currentThrowable = t;
          while (true) {
              printThrowable0(context, currentThrowable, prevThrowable);
              final Throwable nextThrowable = currentThrowable.getCause();
              if (currentThrowable != nextThrowable && nextThrowable != null) {
                  prevThrowable = currentThrowable;
                  currentThrowable = nextThrowable;
                  context.append("Caused by: ");
              } else {
                  break;
              }
          }
      }
docs: Print a {@code Throwable}.
  
  @param t Throwable to print.