diff --git a/app/workers/sync_objects_on_stripe_worker.rb b/app/workers/sync_objects_on_stripe_worker.rb index baacc65af..b190f6828 100644 --- a/app/workers/sync_objects_on_stripe_worker.rb +++ b/app/workers/sync_objects_on_stripe_worker.rb @@ -29,7 +29,11 @@ class SyncObjectsOnStripeWorker logger.debug "#{index} / #{total}" Stripe::Coupon.retrieve(coupon.code, api_key: Setting.get('stripe_secret_key')) rescue Stripe::InvalidRequestError - Stripe::Service.new.create_coupon(coupon.id) + begin + Stripe::Service.new.create_coupon(coupon.id) + rescue Stripe::InvalidRequestError => e + logger.warn "Unable to create coupon #{coupon.code} on stripe: #{e}" + end end w = StripeWorker.new