/ Published in: Ruby
Figure out shopify shop status
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
begin ShopifyAPI::Shop.current rescue ActiveResource::ResourceNotFound Rails.logger.info "Shop #{shop.id} (#{shop.subdomain}) appears to have gone bye bye" shop.destroy rescue ActiveResource::UnauthorizedAccess => e Rails.logger.info "Shop #{shop.id} (#{shop.subdomain}) does not authorize us" rescue ActiveResource::ForbiddenAccess => e Rails.logger.info "Shop #{shop.id} (#{shop.subdomain}) is a forbidden garden" rescue ActiveResource::Redirection Rails.logger.info "Shop #{shop.id} (#{shop.subdomain}) bounced us" end