Skip to content
Snippets Groups Projects
Commit 67a0b070 authored by Patrick Steinhardt's avatar Patrick Steinhardt
Browse files

operations: Introduce structured errors for UserCreateTag

The UserCreateTag RPC has several conditions where it fails to create
the tag, but still returns a successful response. That response may
either contain a pre-receive error message indicating that updating the
reference has failed because of one of multiple reasons, or it may
indicate that the tag exists already.

Returning successfully in error cases is a code smell, and we have
started to convert all RPCs that do this to instead return structured
errors. With these structured errors, we are able to keep up the
semantics that failure to perform the action results in an error but
keep the client's ability to special-case some specific errors.

Convert UserCreateTag to do the same and return UserCreateTagErrors.
This both gives us better visibility into what exactly is happening on
the Gitaly side and fixes another case where we needlessly create
replication jobs because of missing transactional votes.

Changelog: fixed
parent cd8242f9
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment