Skip to content

Commit

Permalink
fix(artifacts/github): fix error with malformed ref (#2613)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwander authored May 9, 2018
1 parent 23d4161 commit eca89c4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ private String credentialsFromFile(String filename) {
}

public InputStream download(Artifact artifact) throws IOException {
HttpUrl.Builder metadataUrlBuilder = HttpUrl.parse(artifact.getReference()).newBuilder();
HttpUrl.Builder metadataUrlBuilder;
try {
metadataUrlBuilder = HttpUrl.parse(artifact.getReference()).newBuilder();
} catch (Exception e) {
throw new IllegalArgumentException("Malformed github content URL in 'reference'. Read more here https://www.spinnaker.io/reference/artifacts/types/github-file/: " + e.getMessage(), e);
}
String version = artifact.getVersion();
if (StringUtils.isEmpty(version)) {
log.info("No version specified for artifact {}, using 'master'.", version);
Expand Down

0 comments on commit eca89c4

Please sign in to comment.