Skip to content

Commit 8b3f03f

Browse files
committed
CQI return an appropriate HTTP code when no webhook processors was registered in Jenkins
1 parent c2db35f commit 8b3f03f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/hooks/BitbucketSCMSourcePushHookReceiver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public HttpResponse doNotify(StaplerRequest2 req) throws IOException {
123123
}
124124

125125
private BitbucketWebhookProcessor getHookProcessor(Map<String, String> reqHeaders,
126-
MultiValuedMap<String, String> reqParameters) {
126+
MultiValuedMap<String, String> reqParameters) {
127127
BitbucketWebhookProcessor hookProcessor;
128128

129129
List<BitbucketWebhookProcessor> matchingProcessors = getHookProcessors()
@@ -149,7 +149,7 @@ private BitbucketWebhookProcessor getHookProcessor(Map<String, String> reqHeader
149149
ExtensionList<BitbucketWebhookProcessor> processors = ExtensionList.lookup(BitbucketWebhookProcessor.class);
150150
if (processors.isEmpty()) {
151151
logger.warning(() -> "No registered processors found in the system.");
152-
throw new BitbucketWebhookProcessorException(HttpServletResponse.SC_BAD_REQUEST, "No registered processors found in Jenkins. Refer to the user documentation on how configure the webHook in Bitbucket at https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/master/docs/USER_GUIDE.adoc#webhooks-registering");
152+
throw new BitbucketWebhookProcessorException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "No registered processors found in Jenkins. Refer to the user documentation on how configure the webHook in Bitbucket at https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/master/docs/USER_GUIDE.adoc#webhooks-registering");
153153
}
154154
return processors.stream();
155155
}

0 commit comments

Comments
 (0)