Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking issue for StatusOr Experimental API #11563

Open
kannanjgithub opened this issue Sep 26, 2024 · 0 comments
Open

Tracking issue for StatusOr Experimental API #11563

kannanjgithub opened this issue Sep 26, 2024 · 0 comments
Assignees
Labels
experimental API Issue tracks stabilizing an experimental API
Milestone

Comments

@kannanjgithub
Copy link
Contributor

Allow null?
StatusOr needs to be as expressive as a method return value, although it will generally not be null. Can potentially use StatusOr<@nonnull> in cases it should be disallowed.

Should getValue() throw if there is no value?
Go with just getValue() throwing IllegalStateException for now. Can add getValueOrNull, getValueOrDefault, getValueOrThrow as we find usecases. Seems the majority case should check getStatus() first.

@kannanjgithub kannanjgithub self-assigned this Sep 26, 2024
@ejona86 ejona86 added this to the Next milestone Sep 27, 2024
@larry-safran larry-safran added the experimental API Issue tracks stabilizing an experimental API label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental API Issue tracks stabilizing an experimental API
Projects
None yet
Development

No branches or pull requests

3 participants