Skip to content

Commit

Permalink
Add a more informative error message when Dockerfile is unavailable d…
Browse files Browse the repository at this point in the history
…uring s2i

(cherry picked from commit 7c19353)
  • Loading branch information
geoand authored and gsmet committed Mar 23, 2021
1 parent c140b9f commit eefca21
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ public class ApplyDockerfileToBuildConfigDecorator extends NamedResourceDecorato

public ApplyDockerfileToBuildConfigDecorator(String name, Path pathToDockerfile) {
super(name);
if (!pathToDockerfile.toFile().exists()) {
throw new IllegalArgumentException(
"Specified Dockerfile: '" + pathToDockerfile.toAbsolutePath().toString() + "' does not exist.");
}
if (!pathToDockerfile.toFile().isFile()) {
throw new IllegalArgumentException(
"Specified Dockerfile: '" + pathToDockerfile.toAbsolutePath().toString() + "' is not a normal file.");
}
this.pathToDockerfile = pathToDockerfile;
}

Expand Down

0 comments on commit eefca21

Please sign in to comment.