Added tests for repository
This commit is contained in:
@@ -20,14 +20,14 @@ module Pruning
|
||||
with_retries(max_tries: NUMBER_OF_RETRIES, rescue: [Pruning::Exceptions::ServerErrorOnOrigin]) do
|
||||
begin
|
||||
resp = @client.get(url(name))
|
||||
rescue RestClient::ExceptionWithResponse => e
|
||||
raise Pruning::Exceptions::ServerErrorOnOrigin if e.response.code != 404
|
||||
raise Pruning::Exceptions::OriginCannotFindTheResource
|
||||
end
|
||||
|
||||
return JSON(resp.body)
|
||||
rescue RestClient::ExceptionWithResponse => e
|
||||
raise Pruning::Exceptions::ServerErrorOnOrigin if e.response.code != 404
|
||||
raise Pruning::Exceptions::OriginCannotFindTheResource
|
||||
end
|
||||
raise Pruning::Exceptions::UnexpectedError
|
||||
|
||||
return JSON(resp.body)
|
||||
end
|
||||
raise Pruning::Exceptions::UnexpectedError
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user