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

Expose error type checker for rest client #3309

Closed
rikatz opened this issue Dec 11, 2023 · 0 comments · Fixed by #3310
Closed

Expose error type checker for rest client #3309

rikatz opened this issue Dec 11, 2023 · 0 comments · Fixed by #3310
Assignees

Comments

@rikatz
Copy link
Contributor

rikatz commented Dec 11, 2023

Is your feature request related to a problem? Please describe.
There is no way today to check for an error type of rest Client. Because it is a private struct (https://github.com/vmware/govmomi/blob/v0.33.1/vapi/rest/client.go#L150) we cannot check if the returned error was not found, or something else.

At least creating an util that checks if an error is statusError and if it matches the desired status code would be really helpful

Describe the solution you'd like
Expose an util function for checking the returned error code from statusError

Describe alternatives you've considered
Right now the only alternative is to check the error string

Additional context
Add any other context or screenshots about the feature request here.

@rikatz rikatz self-assigned this Dec 11, 2023
rikatz added a commit to rikatz/govmomi that referenced this issue Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant