Posted By

gterrill on 01/12/15


Tagged


Versions (?)

Figure out shopify shop status


 / Published in: Ruby
 

Figure out shopify shop status

  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  

You need to login to post a comment.