errorOrNull property

  1. @useResult
E? errorOrNull

The contained error if this is an Err, or null otherwise.

Examples

// prints "null"
print(const Ok<int, String>(2).errorOrNull);

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

Implementation

@useResult
E? get errorOrNull;