clojure-style-guide icon indicating copy to clipboard operation
clojure-style-guide copied to clipboard

Add section warning against catching Throwables

Open NoahTheDuke opened this issue 5 months ago • 2 comments

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.

NoahTheDuke avatar Jun 23 '25 18:06 NoahTheDuke