isErrAnd method
Checks if this is an error and the error matches the predicate.
Returns true only if this is Err and predicate returns true for the error.
Use this for conditional error checking without extracting the error value.
For other checks, use isErr or pattern matching.
Example:
if (result.isErrAnd((e) => e.code == 404)) {
print('Not found');
}
Implementation
bool isErrAnd(bool Function(E error) predicate) => switch (this) {
Err(:final error) => predicate(error),
Ok() => false,
};