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

gRPC interceptor to transform kubernetes errors to gRPC errors #30

Closed
jessesuen opened this issue Mar 9, 2018 · 1 comment · Fixed by #89
Closed

gRPC interceptor to transform kubernetes errors to gRPC errors #30

jessesuen opened this issue Mar 9, 2018 · 1 comment · Fixed by #89
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jessesuen
Copy link
Member

We should have an gRPC interceptor which translates kubernetes errors into the corresponding gRPC codes. The interceptor would have logic like:

apierr "k8s.io/apimachinery/pkg/api/errors"

if apierr.IsNotFound(err) {
    err = grpc.Errorf(codes.NotFound, err.Error())
} else if apierr.IsAlreadyExists(err) {
    err = grpc.Errorf(codes.AlreadyExists, err.Error())
}
@merenbach merenbach self-assigned this Apr 13, 2018
@merenbach
Copy link
Contributor

@merenbach merenbach added the enhancement New feature or request label Apr 14, 2018
@jessesuen jessesuen added this to the 0.3.0 milestone Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants