Skip to content

Add section warning against catching Throwables #264

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NoahTheDuke
Copy link

@NoahTheDuke NoahTheDuke commented Jun 23, 2025

I've noticed that many Clojure programmers use (catch Throwable t ...) as a means of not dealing with Exceptions. However, this is poor Java practice given that Errors are generally treated as "the application should fail" situations. As such, I think it would be nice to have a recommendation against using (catch Throwable t ...) alongside a nudge towards using explicit Error and Exception classes in catch clauses.

cf: Blind Rescues in the Ruby Style Guide, the recommendation of the Java Docs on Errors.

@seancorfield
Copy link
Collaborator

I agree with the advice Noah wants to add here (even tho' I'm guilty of catching Throwable myself).

BTW, I've fixed the codespell failure on the main branch (ignore rouge).

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

Successfully merging this pull request may close these issues.

2 participants