code: protected static String printException(final Throwable throwable)
      {
          if (null == throwable) {
              return null;
          }
          final ByteArrayOutputStream baos = new ByteArrayOutputStream();
          final PrintStream printStream = new PrintStream(baos);
          throwable.printStackTrace(printStream);
          String exceptionStr = "";
          try {
              exceptionStr = baos.toString("UTF-8");
          } catch (Exception ex) {
              exceptionStr = "Unavailable";
          } finally {
              closeStream(printStream);
              closeStream(baos);
          }
          return exceptionStr;
      }
docs: prints a exception into a string
  @param throwable
  @return