errorOrNull method

BaseError? errorOrNull()

Returns the error if this is a Result.error or null otherwise.

Implementation

BaseError? errorOrNull() => fold((error) => error, (_) => null);