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

Feature request: Promote "key not found" errors to ones from go-directory/pkg/derr #21

Open
bendoerr opened this issue May 11, 2023 · 0 comments

Comments

@bendoerr
Copy link

When using the ReaderClient it is kind of clunky to catch gets that are for non existent keys. For example this is the current matching that I have in place. As far as I can tell that "key not found" message is coming straight from boltdb.

	if err != nil {
		if status, ok := status.FromError(err); ok && status.Message() == "key not found" {
			return nil, nil
		}
		return nil, fmt.Errorf("topaz.DirectoryClient.GetObject/reader.GetObject: %w", err)
	}

If they were promoted to one of the errors in https://github.com/aserto-dev/go-directory/blob/main/pkg/derr/errors.go or other well defined grpc status error that would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant