Fuzion Logo
flang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

try

🌌try

try -- simple exception effect

try provides an operation 'raise' that immediately stops execution and
returns an 'error' wrapped in an 'oucome'.

mutuable field to receive the error in case raise is called

install this effect and execute 'f'. Wrap the result of 'f' into an
'outcome' if 'f' returns normally, otherwise if 'f' is aborted early
via a call to 'raise' wrap the 'error' passed to 'raise' into the
resulting 'outcome'.

terminate immediately with the given error wrapped in 'outcome'.