Skip to content

Modern Result Failure

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Result › Result › Failure

Failure

Returns the reason by reference; raises an error if the Result succeeded.

Syntax

Failure( ) byref as E

Examples

#import "std/outcome"
using outcome

dim r as Result( of int32, ustring ) = Fail( of int32, ustring )( "not a number" )

print r.Failure( )           '' not a number

'' Byref, like Value( )
r.Failure( ) = "bad input"
print r.Failure( )           '' bad input

'' On a SUCCESSFUL Result this raises, symmetrically with Value( ) on a
'' failure. IsOk( ) is the guard for both.

Library: Result
Category: Result
Documented under: Members

Clone this wiki locally