public void reportProblem()

in commit-status-publisher-server/src/main/java/jetbrains/buildServer/commitPublisher/CommitStatusPublisherProblems.java [44:79]


  public void reportProblem(@NotNull String errorMessage,
                              @NotNull CommitStatusPublisher publisher,
                              @NotNull String buildDescription,
                              @Nullable String destination,
                              @Nullable Throwable t,
                              @NotNull Logger logger) {

    String dst = (null == destination) ? "" : "(" + destination + ")";
    if (!(buildDescription.startsWith("build") || buildDescription.startsWith("Build"))) {
      buildDescription = "build " + buildDescription;
    }
    String errorDescription = String.format("Failed to publish status for the %s to %s%s: %s",
                                   buildDescription, publisher.toString(), dst, errorMessage);
    if (null != t) {
      logger.warnAndDebugDetails(errorDescription, t);
      String exMsg = t.getMessage();
      if (!errorDescription.endsWith(".")) {
        errorDescription += ".";
      }
      if (null != exMsg) {
        errorDescription += " " + exMsg;
      } else {
        errorDescription += " " + t.toString();
      }
    } else {
      logger.warn(errorDescription);
    }

    // TW-87136: If the publisher was created automatically, users will likely not be able to deal with publishing problems.
    if (publisher.hasBuildFeature()) {
      SBuildType buildType = publisher.getBuildType();
      SystemProblem problem = new SystemProblem(errorDescription, null, Constants.COMMIT_STATUS_PUBLISHER_PROBLEM_TYPE, null);

      myTicketManager.reportProblem(buildType, publisher.getBuildFeatureId(), problem);
    }
  }