Skip to content

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

Open
@bendoerr

Description

@bendoerr

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions