Skip to content

Tags::CreateService: add a handler for NoRepository exception

What does this MR do and why?

Contributes to #525296 (closed)

Problem

When provided tag information is incorrect, Gitaly returns a "Could not update refs/tags/%s. Please refresh and try again." error.

This error is not handled by Rails and causes a 500 error.

Solution

Add a handler for this exception and return a user-friendly error message instead.

References

Screenshots or screen recordings

Before After
Screenshot_2025-03-17_at_11.02.29 Screenshot_2025-03-17_at_11.01.55

How to set up and validate locally

  1. Visit create new tag page
  2. Try to create a tag with name (includes special symbols): test
  3. You should see a human-friendly error

MR acceptance checklist

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

Edited by Vasilii Iakliushin

Merge request reports

Loading