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

Only throw Exceptions, not Throwables #60

Open
whilo opened this issue Apr 13, 2024 · 0 comments
Open

Only throw Exceptions, not Throwables #60

whilo opened this issue Apr 13, 2024 · 0 comments

Comments

@whilo
Copy link

whilo commented Apr 13, 2024

According to the JVM specification Throwables should not be caught, because they can include runtime Errors that are not recoverable https://docs.oracle.com/javase/specs/jls/se7/html/jls-11.html. Slingshot currently casts ExceptionInfo to Throwable https://github.com/scgilardi/slingshot/blob/release/src/slingshot/support.clj#L37, which forces me to catch Throwables including severe unrecoverable runtime errors. It should be sufficient to put a cast to ^Exception there. I can open a PR if this sounds reasonable.

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