Skip to content

gitaly: Handle structured `NOT_FOUND` errors

Justin Tobler requested to merge jt/structured-not-found into master

What does this MR do and why?

When a Gitaly RPC returns an error with the NOT_FOUND status code, GitLab converts the error into Gitlab::Git::Repository::NoRepository. Some Gitaly RPC error scenarios, such as reference not found, should also use the NOT_FOUND status code, but are instead forced to use INTERNAL because of how the error gets converted in GitLab.

Check NOT_FOUND GRPC errors for structured error details to differentiate client error scenarios.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Justin Tobler

Merge request reports