error property

  1. @useResult
E error

Returns the contained error.

Unlike Result.unwrapErr, this method is known to never throw because the success variant cannot possibly be instantiated.

Examples

// prints "error"
print(const Err<int, String>('error').error);

Implementation

@useResult
E get error => err.unwrap();