Skip to content

Commit

Permalink
Catch all kinds of exceptions
Browse files Browse the repository at this point in the history
It seems there are some really strange formated manifest files, so
better catch all kind of runtime exceptions for parsing it.
  • Loading branch information
laeubi committed Jan 22, 2025
1 parent 4101a12 commit faab10d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
import org.eclipse.tycho.artifacts.ArtifactVersionProvider;
import org.eclipse.tycho.core.osgitools.BundleReader;
import org.eclipse.tycho.core.osgitools.OsgiManifest;
import org.eclipse.tycho.core.osgitools.OsgiManifestParserException;
import org.osgi.framework.BundleException;
import org.osgi.framework.VersionRange;
import org.osgi.framework.namespace.PackageNamespace;

Expand Down Expand Up @@ -169,7 +167,10 @@ private ModuleRevisionBuilder readOSGiInfo(Path path) {
try {
OsgiManifest manifest = bundleReader.loadManifest(path.toFile());
return OSGiManifestBuilderFactory.createBuilder(manifest.getHeaders());
} catch (BundleException | OsgiManifestParserException e) {
} catch (Exception e) {
// On maven there might be all kind of badly formated manifests ... if we can't
// parse it and create even a basic valid OSGi one than the artifacts is
// unlikely usable in OSGI context anyways
}
}
return null;
Expand Down

0 comments on commit faab10d

Please sign in to comment.