-
While talking on Slack with Modood, a problematic appeared I don't think we have a solution for right now: Shouldn't we introduce a flow directive in the catch block ? @cdavernas @fjtirado @matthias-pichler-warrify @ricardozanini wdyt ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
IMHO it's a good bad idea: |
Beta Was this translation helpful? Give feedback.
IMHO it's a good bad idea:
try/catch
is not aswitch
(aka flow control).To do what you propose, you can do something in the
do
, thenswitch
. Having athen
at top level plus one in the catch clause would be IMO confusing, in addition of adding a new flow control that WILL be misused (ex: throwing an error to explicitly flow using the catch clause).The
try
clause is not intended, in any language I know of, to be a flow directive. It's a construct to handle an error then continue/resume the normal flow.