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

fix: add additional potential exceptions when retrieving protobuf manifest file to get version #3315

Merged
merged 4 commits into from
Oct 25, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ static Optional<String> getBundleVersion(Class<?> clazz) {
Attributes attributes = jar.getManifest().getMainAttributes();
return Optional.ofNullable(attributes.getValue("Bundle-Version"));
}
} catch (URISyntaxException | IOException e) {
} catch (URISyntaxException
| IOException
| IllegalArgumentException
| SecurityException
| NullPointerException e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just catch Exception? Is there any Exception that we would want to propagate from here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, we should safely ignore this as it doesn't block runtime.

// Unable to read Bundle-Version from manifest. Recover gracefully.
return Optional.empty();
}
Expand Down
Loading