lib/etsy/response.rb in etsy-0.2.5 vs lib/etsy/response.rb in etsy-0.2.6
- old
+ new
@@ -2,10 +2,12 @@
class OAuthTokenRevoked < StandardError; end
class MissingShopID < StandardError; end
class EtsyJSONInvalid < StandardError; end
class TemporaryIssue < StandardError; end
+ class ResourceUnavailable < TemporaryIssue; end
+ class ExceededRateLimit < TemporaryIssue; end
class InvalidUserID < StandardError; end
# = Response
#
# Basic wrapper around the Etsy JSON response data
@@ -75,10 +77,12 @@
def validate!
raise OAuthTokenRevoked if token_revoked?
raise MissingShopID if missing_shop_id?
raise InvalidUserID if invalid_user_id?
- raise TemporaryIssue if temporary_etsy_issue? || resource_unavailable? || exceeded_rate_limit?
+ raise TemporaryIssue if temporary_etsy_issue?
+ raise ResourceUnavailable if resource_unavailable?
+ raise ExceededRateLimit if exceeded_rate_limit?
raise EtsyJSONInvalid.new("CODE: #{code}, BODY: #{data}") unless valid_json?
true
end
def valid_json?