-
Notifications
You must be signed in to change notification settings - Fork 48
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
Catching IOException when the image name is invalid #320
Conversation
Codecov Report
@@ Coverage Diff @@
## master #320 +/- ##
=========================================
Coverage 81.47% 81.47%
Complexity 263 263
=========================================
Files 19 19
Lines 934 934
Branches 126 126
=========================================
Hits 761 761
Misses 142 142
Partials 31 31
|
@@ -74,7 +74,7 @@ public void execute(final Namespace ns, final DockerfileGitHubUtil dockerfileGit | |||
} | |||
}); | |||
} | |||
} catch (GHException | HttpException e){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are sure we don't still also need HttpException
? I guess IOException
is a superset 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you forgot to clean up the import on httpexception
Could you provide more information on what the scenario is here? It's unclear what is happening and why this should be an exception rather than a validation. |
Added here |
What do we mean by an "invalid image name"? It doesn't exist? The format is not correct? Examples would be useful if you could redact them. Thanks again! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are good. We *
add exception
Yeah sure. This is the logic we have to determine the validity of an image name. An example of an invalid image name would be |
weird... cool thanks for the info 😄 might be helpful for others too |
On running the All subcommand, if there is an image in the tag store that has an invalid image name, the findFilesWithImage method throws an IOException here. However, in the All subcommand execute path we are not catching this exception. As a result, if the image tag store has one entry with an invalid image name, the all subcommand will exit once it hits that entry and not process the following entries.
This fix allows us to catch these exceptions and move on to processing the following images in the image tag store.