Figure out shopify shop status


/ Published in: Ruby
Save to your folder(s)

Figure out shopify shop status


Copy this code and paste it in your HTML
  1. begin
  2. ShopifyAPI::Shop.current
  3. rescue ActiveResource::ResourceNotFound
  4. Rails.logger.info "Shop #{shop.id} (#{shop.subdomain}) appears to have gone bye bye"
  5. shop.destroy
  6. rescue ActiveResource::UnauthorizedAccess => e
  7. Rails.logger.info "Shop #{shop.id} (#{shop.subdomain}) does not authorize us"
  8. rescue ActiveResource::ForbiddenAccess => e
  9. Rails.logger.info "Shop #{shop.id} (#{shop.subdomain}) is a forbidden garden"
  10. rescue ActiveResource::Redirection
  11. Rails.logger.info "Shop #{shop.id} (#{shop.subdomain}) bounced us"
  12. end

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.