Skip to content

operations: Fix wrong error code when UserSquash conflicts

With the new improved error hadnling in UserSquash we're now returning errors in some cases where we previously didn't. One of those cases is when the rebase performed during the squash results in a merge conflict. While it is correct to return an error in this case, we're using an Internal error code for this case, which indicates that Gitaly is to blame instead of the parameters which have been passed by the user.

Fix the error code to instead be FailedPrecondition. This error code is special-cased by our monitoring infrastructure to not raise any alerts.

Note that this change is only fixing issues with monitoring: Rails handles the error alright by inspecting the error details instead of the error code.

Changelog: fixed

Part of #4099 (closed)

Merge request reports