result.error
The first error diagnostic of a failure.
Usage
Result.error<T>(r: Result<T>): KernelDiagnostic | undefinedParameters
rResult<T>The result to read.
Returns
The first diagnostic of severity error, else the first diagnostic of the failure; undefined for a success.
Example
Result.error(Result.fail('GEOMETRY_OP_FAILED', 'no hull')).code // → 'GEOMETRY_OP_FAILED'
Result.error(Result.ok(1)) // → undefined