Skip to content

Commit 8eb44ce

Browse files
committed
small improvements
(cherry picked from commit 86d2524)
1 parent a002384 commit 8eb44ce

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

commit-status-publisher-server/src/main/java/jetbrains/buildServer/commitPublisher/gitea/GiteaPublisher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ private void publish(@NotNull String message,
275275
try {
276276
publish(revision.getRevision(), message, repository, buildDescription);
277277
} catch (Exception e) {
278-
throw new PublisherException("Cannot publish status to Gitea for VCS root " +
278+
throw new PublisherException("Cannot publish status to Gitea(" + apiUrl + ") for VCS root " +
279279
revision.getRoot().getName() + ": " + e.toString(), e);
280280
}
281281
}

commit-status-publisher-server/src/main/java/jetbrains/buildServer/commitPublisher/gitea/GiteaSettings.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ public void testConnection(@NotNull BuildTypeIdentity buildTypeOrTemplate, @NotN
128128
if (Objects.equals(statusCode, 404)) {
129129
throw new PublisherException(String.format("Repository \"%s\" can not be found. Please check if it was renamed or moved to another namespace", repository.repositoryName()));
130130
}
131+
if (Objects.equals(statusCode, 401) || Objects.equals(statusCode, 403)) {
132+
throw new PublisherException(String.format("Cannot access the \"%s\" repository. Ensure you are using a valid access token instead of a password (authentication via password is no longer available)", repository.repositoryName()));
133+
}
134+
throw new PublisherException("Request was failed with error", pe);
131135
} catch (Exception ex) {
132136
throw new PublisherException(String.format("Gitea publisher has failed to connect to \"%s\" repository", repository.url()), ex);
133137
}

0 commit comments

Comments
 (0)