lucid-shopify 0.63.1 → 0.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffe59e48e1d046fa4eb07460911384691bda6c07981b056cb3c89dd48d95514f
4
- data.tar.gz: 778d7a488544cb0452290010eff0ff59db765afd55abd8bbdefd674b38984a79
3
+ metadata.gz: 1b0b5d01a7f0169127f5cb34c55771e87790f9e15059e384874321566cb257c4
4
+ data.tar.gz: fac44b65de85d005f9affe1532892a2b3baaa85b066ca407ffcadfe880c3d785
5
5
  SHA512:
6
- metadata.gz: 9ed2477757ec40d6464699bc8a930604f21b5aee5ccabaef0eebd1113fa4a73a1edbb76db8bfc50cb35a53f11440fda704535e0e982daa490f9e6e03deab66d8
7
- data.tar.gz: 03d6ea262fc118da219fb18f11478da1d4a384c0d50b7a67e6b4941abd6112d82c854a4dd57f5de7b5510d28b781d0e647f28cd8ed1f14dffa6cca71753dc126
6
+ metadata.gz: 1087a99b8ad46cb6fe571a4812dfc47eb3c67cfba2dd85d4d0c9bc069913f0ff9c8e869ed8b2e9a0a172307751a156eef080e0d560d573076946a32345f90fc8
7
+ data.tar.gz: 929282d2d2b752515a143cd06fcb26b66b1209594be0785c1cd9cc2418476f55c7ee63f7f95d975ca8530f276e2592269ee822f5dba5c99f56ed032fcffafdcb
@@ -15,7 +15,7 @@ module Lucid
15
15
  case link_header
16
16
  # NOTE: There is a strange behaviour where it seems that if the header
17
17
  # value exceeds a certain length, it is split into chunks. It seems that
18
- # if you use {HTTP::Headers#get}, you will always get {Array<String},
18
+ # if you use {HTTP::Headers#get}, you will always get {Array<String>},
19
19
  # and it is the special behaviour of {HTTP::Headers#[]} causing this.
20
20
  #
21
21
  # However, why is it split in the first place? Does Shopify send
@@ -29,8 +29,8 @@ module Lucid
29
29
  ClientError = Class.new(Error)
30
30
  ServerError = Class.new(Error)
31
31
  ShopError = Class.new(Error)
32
-
33
- class GraphQLClientError < ClientError
32
+ AccessTokenError = Class.new(ClientError)
33
+ GraphQLClientError = Class.new(ClientError) do
34
34
  def message
35
35
  case
36
36
  when response.errors?
@@ -114,6 +114,12 @@ module Lucid
114
114
  # @note https://shopify.dev/concepts/about-apis/response-codes
115
115
  def assert!
116
116
  case status_code
117
+ when 401
118
+ if error_message?([/access token/i])
119
+ raise AccessTokenError.new(request, self), 'Invalid access token'
120
+ else
121
+ raise ClientError.new(request, self)
122
+ end
117
123
  when 402
118
124
  raise ShopError.new(request, self), 'Shop is frozen, awaiting payment'
119
125
  when 403
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lucid
4
4
  module Shopify
5
- VERSION = '0.63.1'
5
+ VERSION = '0.64.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucid-shopify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.63.1
4
+ version: 0.64.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelsey Judson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-06 00:00:00.000000000 Z
11
+ date: 2020-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv