isErr property

bool get isErr

Returns true if this result is a failure (Err).

Use this for conditional logic checking if an error occurred. For checking whether an error matches a condition, use isErrAnd instead.

Example:

if (result.isErr) {
  print('Operation failed');
}

Implementation

bool get isErr => this is Err<T, E>;