Calls f(result.err) with side effect if this result is Err. Anyway returns this result as is.
Result<T> onErr(Function(Error) f) { if (isErr) { f(err!); } return this; }