Convert /cpn/ loading errors to warnings

Idk why this broke again, it works locally for me, did our IP get
banned or something? We'll look into it another time!
This commit is contained in:
Emi Matchu 2024-01-23 22:11:10 -08:00
parent 44d9f98313
commit 09ad6d5fbb

View file

@ -135,9 +135,9 @@ class PetType < ApplicationRecord
begin begin
res.error! res.error!
rescue Exception => e rescue Exception => e
raise DownloadError, "Error loading CPN image at #{cpn_uri}: #{e.message}" Rails.logger.warn "Error loading CPN image at #{cpn_uri}: #{e.message}"
else else
raise DownloadError, "Error loading CPN image at #{cpn_uri}. Response: #{res.inspect}" Rails.logger.warn "Error loading CPN image at #{cpn_uri}. Response: #{res.inspect}"
end end
end end
new_url = res['location'] new_url = res['location']
@ -146,7 +146,7 @@ class PetType < ApplicationRecord
self.image_hash = new_image_hash self.image_hash = new_image_hash
Rails.logger.info "Successfully loaded #{cpn_uri}, saved image hash #{new_image_hash}" Rails.logger.info "Successfully loaded #{cpn_uri}, saved image hash #{new_image_hash}"
else else
raise DownloadError, "CPN image pointed to #{new_url}, which does not match CP image format" Rails.logger.warn "CPN image pointed to #{new_url}, which does not match CP image format"
end end
end end
end end