code: protected void buildSmartStackTrace(StringBuilder sb, Throwable cause, int nestLevel) { // similar to application exception's one
          sb.append(LF).append(nestLevel > 0 ? "Caused by: " : "");
          sb.append(cause.getClass().getName()).append(": ").append(cause.getMessage());
          final StackTraceElement[] stackTrace = cause.getStackTrace();
          if (stackTrace == null) { // just in case
              return;
          }
          final int limit = nestLevel == 0 ? 10 : 3;
          int index = 0;
          for (StackTraceElement element : stackTrace) {
              if (index > limit) { // not all because it's not error
                  sb.append(LF).append("  ...");
                  break;
              }
              final String className = element.getClassName();
              final String fileName = element.getFileName(); // might be null
              final int lineNumber = element.getLineNumber();
              final String methodName = element.getMethodName();
              sb.append(LF).append("  at ").append(className).append(".").append(methodName);
              sb.append("(").append(fileName);
              if (lineNumber >= 0) {
                  sb.append(":").append(lineNumber);
              }
              sb.append(")");
              ++index;
          }
          final Throwable nested = cause.getCause();
          if (nested != null && nested != cause) {
              buildSmartStackTrace(sb, nested, nestLevel + 1);
          }
      }
docs: ============