Skip to content

Commit 47628ff

Browse files
authored
Provide Exception message for wrong Schema
When a user provides a schema in the RespositoryName he receives the InvalidRepositoryNameException without an meaningful explanation. This leads to confusion. I had to look up the source to understand why this exception was thrown.
1 parent c5c8932 commit 47628ff

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/main/java/com/github/dockerjava/core/NameParser.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ public static void validateRepoName(String name) {
100100

101101
public static HostnameReposName resolveRepositoryName(String reposName) {
102102
if (reposName.contains("://")) {
103-
// It cannot contain a scheme!
104-
throw new InvalidRepositoryNameException();
103+
throw new InvalidRepositoryNameException("RepositoryName shouldn't contain a scheme");
105104
}
106105

107106
String[] nameParts = reposName.split("/", 2);

0 commit comments

Comments
 (0)