try only block #2151
-
Sometimes I just want to 'try' something without being interested in exception handling
Which could be shorten to
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Since you can already write this as
I cannot envision a world where the language would put in the effort to support something that would be near universally panned as a bad idea. |
Beta Was this translation helpful? Give feedback.
-
I think M# had something like |
Beta Was this translation helpful? Give feedback.
-
Consider a public API, which has one or more events:
When a consumer of this API is not handling possible exceptions, they will break through the API:
Why should the API take care of any of such exceptions? Actually this was my intention |
Beta Was this translation helpful? Give feedback.
-
You should let them bubble up. Ignoring them is certainly not the right thing to do. |
Beta Was this translation helpful? Give feedback.
Since you can already write this as
catch {}
, this seems like a non-starter proposal.I cannot envision a world where the language would put in the effort to support something that would be near universally panned as a bad idea.