CatchResult
type (joe
)
The result type of the standard catch()
function.
The record has two fields, result
and error
.
Static Methods
CatchResult.error()
CatchResult.error(error) → CatchResult
Creates a new CatchResult
indicating a failure. The
error is the specific error, either a String
or
an Error
. The CatchResult
's error
field will be
set to the error, and its result
field will be null.
CatchResult.ok()
CatchResult.ok(result) → CatchResult
Creates a new CatchResult
indicating a successful result.
The result is the result
value; the error
field will
be null.
Methods
catchResult.isError()
catchResult.isError() → Boolean
Returns true if the CatchResult
represents an error
and false if it represents a success.
catchResult.isOK()
catchResult.isOK() → Boolean
Returns true if the CatchResult
represents a success
and false if it represents an error.