Skip to content
代码片段 群组 项目
未验证 提交 35b26cbb 编辑于 作者: Désirée Chevalier's avatar Désirée Chevalier 提交者: GitLab
浏览文件

Raise unexpected errors on GET

上级 56acc4ba
No related branches found
No related tags found
无相关合并请求
......@@ -88,16 +88,16 @@ def api_get_from(get_path)
request = Runtime::API::Request.new(api_client, path)
response = get(request.url)
if response.code == HTTP_STATUS_SERVER_ERROR
raise(InternalServerError, <<~MSG.strip)
Failed to GET #{request.mask_url} - (#{response.code}): `#{response}`.
#{QA::Support::Loglinking.failure_metadata(response.headers[:x_request_id])}
MSG
elsif response.code != HTTP_STATUS_OK
if response.code == HTTP_STATUS_NOT_FOUND
raise(ResourceNotFoundError, <<~MSG.strip)
Resource at #{request.mask_url} could not be found (#{response.code}): `#{response}`.
#{QA::Support::Loglinking.failure_metadata(response.headers[:x_request_id])}
MSG
elsif !success?(response.code)
raise(InternalServerError, <<~MSG.strip)
Failed to GET #{request.mask_url} - (#{response.code}): `#{response}`.
#{QA::Support::Loglinking.failure_metadata(response.headers[:x_request_id])}
MSG
end
response
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册