Skip to content
Permalink
Browse files

[JENKINS-33318] @svanoort's comment was addressed

  • Loading branch information
recena
recena committed Apr 18, 2016
1 parent c990cdf commit 2fab60db66f3d6335825172803e5d4dbd76c6542
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/java/org/jenkinsci/plugins/github_branch_source/Endpoint.java
@@ -122,22 +122,22 @@ public FormValidation doCheckApiUri(@QueryParameter String apiUri) {
} catch (MalformedURLException mue) {
// For example: https:/api.github.com
LOGGER.log(Level.WARNING, "Trying to configure a GitHub Enterprise server: " + apiUri, mue.getCause());
return FormValidation.error("This does not look like a GitHub Enterprise API endpoint (malformed URL)");
return FormValidation.error("The endpoint does not look like a GitHub Enterprise (malformed URL)");
} catch (JsonParseException jpe) {
LOGGER.log(Level.WARNING, "Trying to configure a GitHub Enterprise server: " + apiUri, jpe.getCause());
return FormValidation.error("This does not look like a GitHub Enterprise API endpoint");
return FormValidation.error("The endpoint does not look like a GitHub Enterprise (invalid JSON response)");
} catch (FileNotFoundException fnt) {
// For example: https://github.mycompany.com/server/api/v3/ gets a FileNotFoundException
LOGGER.log(Level.WARNING, "Getting HTTP Error 404 for " + apiUri);
return FormValidation.error("This does not look like a GitHub Enterprise API endpoint (page not found");
return FormValidation.error("The endpoint does not look like a GitHub Enterprise (page not found");
} catch (IOException e) {
// For example: https://github.mycompany.com/api/v3/ or https://github.mycompany.com/api/v3/mypath
if (e.getMessage().contains("private mode enabled")) {
LOGGER.log(Level.FINE, e.getMessage());
return FormValidation.warning("Private mode enabled, validation disabled");
}
LOGGER.log(Level.WARNING, e.getMessage());
return FormValidation.error("This does not look like a GitHub Enterprise API endpoint");
return FormValidation.error("The endpoint does not look like a GitHub Enterprise (verify network and/or try again later)");
}
}

0 comments on commit 2fab60d

Please sign in to comment.
You can’t perform that action at this time.