private static @NotNull String getExceptionStacktrace(@NotNull Throwable exception) {
    StringWriter sw = new StringWriter();
    exception.printStackTrace(new PrintWriter(sw));
    String originalReason = getExceptionOriginalReason(exception);
    if (originalReason != null) {
      sw.append("\nCaused by: ").append(originalReason);
    }
    return sw.toString();
  }
private static @NotNull String getExceptionStacktrace(@NotNull Throwable exception)