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

Option to propagate exceptions in SpaceScanner.accept #108

Closed
kriegaex opened this issue Jan 31, 2024 · 1 comment
Closed

Option to propagate exceptions in SpaceScanner.accept #108

kriegaex opened this issue Jan 31, 2024 · 1 comment

Comments

@kriegaex
Copy link

kriegaex commented Jan 31, 2024

Relates to codehaus-plexus/plexus-compiler#347.

According to my analysis in codehaus-plexus/plexus-compiler#347 (comment), Sisu silently swallows errors caused by UnsupportedClassVersionError. Projects using Sisu Inject cannot react to such problems, because they have no way to find out that anything went wrong. The exception is caught and logged to the debug channel:

https://github.com/eclipse/sisu.inject/blob/550bd96afa244d22ea0fc84bef5d9b0a356bac25/org.eclipse.sisu.inject/src/main/java/org/eclipse/sisu/space/SpaceScanner.java#L113-L116

The only way to see anything on the console is MAVEN_OPTS=-Dsisu.debug, but that only helps in the analysis, not in fixing the problem.

Ironically, the ASM class visitor parsing the target class as such would be able to do so, given that the internal ASM version of Sisu can read the corresponding class file. The UnsupportedClassVersionError does not come from parsing the class, but from trying to load it, which I am not sure is even necessary at this point. Even if it is, consuming projects should have a way to find out about any problems occurring in Sisu and be able to handle them according to their own needs, e.g. by issuing a comprehensive error, log a warning or whatever.

@kwin
Copy link
Contributor

kwin commented Jan 31, 2024

This duplicates #97

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

2 participants