@@ 16,7 16,11 @@ class SyncWhiplashOrderStatusJob < ApplicationJob
{ provider: "api", limit: 200, status: [40, 95, 300] },
"X-API-KEY" => shop.whiplash_api_key
)
- raise response.inspect if response.is_a?(String) || response.status >= 400
+ if response.status == 500
+ Rails.logger.error("500 response from whiplash for shop #{shop.shopify_domain}")
+ return
+ end
+ raise response.body.to_s if response.is_a?(String) || response.status >= 400
response.body.each do |order|
next unless order["originator_id"]