This allows the provided callback to return an ErrorOr-like type to propagate errors back to the caller.