Fail gracefully when remote icon is 404
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b0b56fcf92
commit
f8da034e66
@ -45,8 +45,12 @@ module AppCatalogManager
|
|||||||
filename = "#{attachment_name}.png"
|
filename = "#{attachment_name}.png"
|
||||||
key = "web_apps/#{@app.id}/icons/#{attachment_name}.png"
|
key = "web_apps/#{@app.id}/icons/#{attachment_name}.png"
|
||||||
|
|
||||||
tempfile = Down.download(download_url)
|
begin
|
||||||
@app.send(attachment_name).attach(key: key, io: tempfile, filename: filename)
|
tempfile = Down.download(download_url)
|
||||||
|
@app.send(attachment_name).attach(key: key, io: tempfile, filename: filename)
|
||||||
|
rescue Down::NotFound
|
||||||
|
Rails.logger.warn "Icon download failed: NotFound error for #{download_url}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user