Skip to content

Raise unexpected errors on GET

Désirée Chevalier requested to merge qa-raise-unexpected-errors-on-get into master

What does this MR do and why?

Gives a better error than "Failed to save group {:path=\u003e[\"has already been taken\"]}" by raising the error instead of swallowing it under ResourceNotFoundError and attempting to create the resource anyway. Example: https://gitlab.com/gitlab-org/gitlab/-/issues/496328

Previously, when we would check to see if a resource exists before creating it and got an error, if the error wasn't a 500, we would lump it into the ResourceNotFoundError category which is rescued in group fabricate_via_api.

This change now checks for ResourceNotFoundError first, then any other code that's not a success(200, 201, 202, 204) is raised as an InternalServerError.

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 Désirée Chevalier

Merge request reports

Loading