@Override
    public void handleError(@Nullable Source source, @NotNull Throwable throwable) {
      if (myIsBroken.compareAndSet(false, true)) {
        if (myRecreateMainLogHandler != null) {
          ApplicationManager.getApplication().invokeLater(() -> myRecreateMainLogHandler.accept(source, throwable));
        }
        else {
          LOG.error(source != null ? "Vcs Log exception from " + source : throwable.getMessage(), throwable);
        }

        if (source == Source.Storage) {
          ((VcsLogModifiableIndex)myLogData.getIndex()).markCorrupted();
        }
      }
      else {
        int errorHashCode = ThrowableInterner.computeTraceHashCode(throwable);
        if (myErrors.add(errorHashCode)) {
          LOG.debug("Vcs Log storage is broken and is being recreated", throwable);
        }
      }
    }
@Override
    public void handleError(@Nullable Source source, @NotNull Throwable throwable)