Skip to content

Commit

Permalink
Add exception for 423 API error code
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillplatonov committed Jun 11, 2024
1 parent 1883e5b commit 5b94da7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/shopify_graphql/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def handle_response(response)
raise PreconditionFailed.new(parsed_body(response), code: response.code)
when 422
raise ResourceInvalid.new(parsed_body(response), code: response.code)
when 423
raise ShopLocked.new(parsed_body(response), code: response.code)
when 429, 430
raise TooManyRequests.new(parsed_body(response), code: response.code)
when 401...500
Expand Down
4 changes: 4 additions & 0 deletions lib/shopify_graphql/exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ class ResourceGone < ClientError # :nodoc:
class PreconditionFailed < ClientError # :nodoc:
end

# 423 Locked
class ShopLocked < ClientError # :nodoc:
end

# 429 Too Many Requests
class TooManyRequests < ClientError # :nodoc:
end
Expand Down

0 comments on commit 5b94da7

Please sign in to comment.