Execute whenError if the Result is an error.
@override R? whenError<R>(R Function(E error) whenError) => null;