@NotNull
  public static Pair<Throwable, String> getRootCauseAndLocation(@NotNull Throwable error) {
    Throwable rootCause = error;
    String location = null;

    while (true) {
      if (location == null) {
        location = getLocationFrom(rootCause);
      }
      Throwable cause = rootCause.getCause();
      if (cause == null || cause == rootCause || cause.getMessage() == null && !(cause instanceof StackOverflowError)) {
        break;
      }
      rootCause = cause;
    }

    if (location == null) {
      location = searchForLocationInStacks(error);
    }
    return Pair.create(rootCause, location);
  }
@NotNull
  public static Pair<Throwable, String> getRootCauseAndLocation(@NotNull Throwable error)