Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defect in Error Message Concerning Missing File #473

Open
phreed opened this issue Aug 26, 2021 · 1 comment
Open

Defect in Error Message Concerning Missing File #473

phreed opened this issue Aug 26, 2021 · 1 comment

Comments

@phreed
Copy link

phreed commented Aug 26, 2021

Critical Source Code

void run() {
if (!template.file) {
throw new IllegalStateException("Could not find specified template file ${template.file}")
}

Symptom

When the template file is not present the error does not include the name of the missing file.

 Execution failed for task ':docker-compose:janusgraph-client:generateDockerCompose'.
> Could not find specified template file false

The name of the file is not 'false'.

Cause

Use of template.file effectively calls getTemplate().isFile() which returns a boolean.
This is appropriate for the conditional test but the thrown exception message should be using template.path i.e. getTemplate().getPath().

@phreed
Copy link
Author

phreed commented Aug 26, 2021

As a side note, a nearly identical message appears here:

public void setDockerComposeTemplate(String dockerComposeTemplate) {
this.dockerComposeTemplate = dockerComposeTemplate
Preconditions.checkArgument(project.file(dockerComposeTemplate).exists(),
"Could not find specified template file: %s", project.file(dockerComposeTemplate))
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant