safely
Context runner that uses RaiseScope to safely capture raised or thrown errors, and unwraps either the successful Outcome or the fallback, returning T.
Used in scenarios where you want the advantages of Outcome, but immediately resolve to its Ok type.
Return
The result of the block if successful, or the result of the fallback function if an error occurs.
Parameters
A function that provides a fallback value in case of an raised or thrown exception.
The code to execute within the RaiseScope.
Context runner that uses RaiseScope to safely capture raised or thrown errors, and unwraps either the successful Outcome or the fallback, returning Out.
Used in scenarios where you want the advantages of Outcome, but immediately resolve to its Ok type.
Receiver
Return
The result of the block if successful, or the result of the fallback function if an error occurs.
Parameters
A function that provides a fallback value in case of an raised or thrown exception.
The code to execute within the RaiseScope.