Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
NoahTheDuke wants to merge1 commit intobbatsov:master
base:master
Choose a base branch
Loading
fromNoahTheDuke:nb/catching-throwables

Conversation

NoahTheDuke
Copy link

@NoahTheDukeNoahTheDuke commentedJun 23, 2025
edited
Loading

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 theJava Docs on Errors.

seancorfield reacted with thumbs up emoji
@seancorfield
Copy link
Collaborator

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

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

NoahTheDuke reacted with thumbs up emoji

@NoahTheDuke
Copy link
Author

I rebased on master to fix the spelling mistake.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@bbatsovbbatsovAwaiting requested review from bbatsov

@danielcomptondanielcomptonAwaiting requested review from danielcompton

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@NoahTheDuke@seancorfield

[8]ページ先頭

©2009-2025 Movatter.jp