Skip to content

proto: Introduce FindTagError to distinguish non-existent tags

Patrick Steinhardt requested to merge pks-find-tag-error into master

When the FindTag RPC is invoked with a tag that doesn't exist then we return an Internal gRPC error. This is clearly not ideal given that those errors count against our SLOs, and furthermore it's an expected error condition to say that a tag does not exist. We should thus slap on a proper error code in that condition.

This raises an issue in the Rails codebase though because the NotFound code is typically used to indicate a missing repository. So if we now also start to retrun NotFound for missing tags then it's hard for Rails to distinguish those two error conditions without matching the error's message.

To fix this issue we introduce a structured error that gives the caller a clear indication that the reference was indeed not found so that they can distinguish those two conditions.

Part of #4366 (closed).

Merge request reports

Loading