Skip to content

Raise Internal Server Error on 500 in `api_get_from`

Sanad Liaquat requested to merge qa-shl-raise-server-error-on-500 into master

What does this MR do?

Raises InternalServerError of a 500 is received when creating a resource. This is done to avoid the current catch all behaviour of the Resource where it goes on to create the resource on any failure in api_get_from.

A recent failure in staging prompted this change where the server returned a 500 on api_get and the resource treated it as ResourceNotFoundError and went ahead to create the sandbox group which always exists on staging. So the test failed with Fabrication of QA::Resource::Sandbox using the API failed (400) with {"message":"Failed to save group {:path=\u003e[\"has already been taken\"]}"}.

With this change, the test should fail with a clear 500 on fabricate_via_api!

Related to: #216248 (closed)

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Edited by Yorick Peterse

Merge request reports

Loading