Skip to content

Commit

Permalink
prevent error
Browse files Browse the repository at this point in the history
  • Loading branch information
skaes committed Feb 9, 2024
1 parent c02f7a7 commit 004ed66
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/fpm/fry/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,11 @@ def destroy(container)
path: url,
expects: [204, 409]
)
if res.status == 409
data = JSON.parse(res.body) rescue ({msg: "could not parse response body: '#{res.body}'"})
return unless res.status == 409
data = JSON.parse(res.body) rescue ({"message" => "could not parse response body: '#{res.body}'"})
if data["message"] =~ /removal of container .* is already in progress/
logger.info(data["message"])
else
raise ContainerDeletionFailed.new("could not destroy container #{container}", data)
end
rescue Excon::Error => e
Expand Down

0 comments on commit 004ed66

Please sign in to comment.