From 09ad6d5fbbb2c6475424f2f01738a0f59c98da9c Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Tue, 23 Jan 2024 22:11:10 -0800 Subject: [PATCH] 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! --- app/models/pet_type.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/pet_type.rb b/app/models/pet_type.rb index b0e6f5de..37a3a820 100644 --- a/app/models/pet_type.rb +++ b/app/models/pet_type.rb @@ -135,9 +135,9 @@ class PetType < ApplicationRecord begin res.error! 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 - 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 new_url = res['location'] @@ -146,7 +146,7 @@ class PetType < ApplicationRecord self.image_hash = new_image_hash Rails.logger.info "Successfully loaded #{cpn_uri}, saved image hash #{new_image_hash}" 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