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

spanner: ErrRowNotFound is not compatible with apierror #10604

Closed
golemiso opened this issue Jul 26, 2024 · 1 comment
Closed

spanner: ErrRowNotFound is not compatible with apierror #10604

golemiso opened this issue Jul 26, 2024 · 1 comment
Assignees
Labels
api: spanner Issues related to the Spanner API. triage me I really want to be triaged.

Comments

@golemiso
Copy link

golemiso commented Jul 26, 2024

I found that the latest release has a type compatibility issue.
All of the errors returned from spanner api were compatible with apierror, but with this fix (#10405), errors instantiated as apierror are now overwritten with ErrRowNotFound.

This modification violates #5169

Additional context

Started after upgrading to v1.64.0.

@golemiso golemiso added the triage me I really want to be triaged. label Jul 26, 2024
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Jul 26, 2024
@golemiso
Copy link
Author

golemiso commented Aug 6, 2024

I found a workaround.

I was getting an apierror by the code below and returns non apierror after v1.64.0:

var apiErr *apierror.APIError
if !errors.As(err, &apiErr) {
	return err
}
return apiErr

I found using apierror.FromError works fine before and after v1.64.0:

apiErr, ok := apierror.FromError(err)
if !ok {
	return err
}
return apiErr

@golemiso golemiso closed this as not planned Won't fix, can't repro, duplicate, stale Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants