is_error
Table of Contents
Function
is_error — test if a value is an error
Synopsis
is_error(val: any) -> bool
Description
The is_error function returns true if its argument’s type is error.
is_error(v)
is shortcut for kind(v)=="error"
,
Examples
A simple value is not an error:
yield is_error(this)
true
Loading...
An error value is an error:
yield is_error(this)
true
Loading...
Convert an error string into a record with an indicator and a message:
yield {err:is_error(this),message:under(this)}
"not
an
error"
error("an
error")
Loading...