shoptet 0.0.41 → 0.0.42

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/shoptet.rb +5 -2
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58902b1d779978f5c26c0dfe99770ff3a61a23deeaf475d6cffbce3f19e64a2e
4
- data.tar.gz: d93a5b924492487a45469e325f5e9cf5aa32bd5c23c79aa63b7c481061f31feb
3
+ metadata.gz: 399043de3b029f982d15285133665982d2a5319cd07eb1fcac5fcc6f9d638baa
4
+ data.tar.gz: b842f1af2fc2f4841a97bd7e2f340219622dfb6e019987c8f680756c94285334
5
5
  SHA512:
6
- metadata.gz: e3aca14df29ce6d5aeab5f18cf14c2c10f12c95f469f8373667ccd374f13724732834ec6bfcf834d02d3c2e3feb9a5c7dd5e87be369c5364df1f25ea1d2ab41c
7
- data.tar.gz: 32eb961e391035af210e061005826e258f3e2ef21a9de79f2a16334bf0afbbb3e4c215c64eb1ed2b2f4b23cbb23a75d14efae789b2512ade49ea827d9c5dfeb2
6
+ metadata.gz: b5928b350c88c524127b71cadec3b321e2f2bec8f5755935bd85f8e5c5a6bbe83b26cc1dde6b1aafd4212f6bcbfd6b8bf4a03535515d4f1443f65712cb2558f2
7
+ data.tar.gz: b9ee119a9d23da27164ad6d85889b55640c38f62aacb38ce1434d051d59a0aff073da06d4520cf9c106b162cd3db1802b640e6c97a4214ecbfee8b5d7db4b047
data/lib/shoptet.rb CHANGED
@@ -16,6 +16,7 @@ class Shoptet
16
16
  class SystemMaintenance < StandardError; end
17
17
  class UnknownError < StandardError; end
18
18
  class NonJSONResponse < StandardError; end
19
+ class ProjectNotFound < StandardError; end
19
20
 
20
21
  EXPIRED_TOKEN_CODE = 'expired-token'
21
22
  INVALID_TOKEN_CODE = 'invalid-token'
@@ -26,7 +27,7 @@ class Shoptet
26
27
  end
27
28
 
28
29
  def self.version
29
- '0.0.41'
30
+ '0.0.42'
30
31
  end
31
32
 
32
33
  def self.ar_on_token_error(model)
@@ -292,6 +293,8 @@ class Shoptet
292
293
  raise AddonSuspended
293
294
  elsif (error == 'addon_not_installed')
294
295
  raise AddonNotInstalled
296
+ elsif (error == 'project_not_found')
297
+ raise ProjectNotFound
295
298
  elsif errors.any? { |err| err["errorCode"] == 'invalid-token-no-rights' }
296
299
  raise InvalidTokenNoRights
297
300
  elsif errors.any? { |err| err["errorCode"] == 'stock-not-found' }
@@ -305,7 +308,7 @@ class Shoptet
305
308
  elsif errors.any? { |err| err["errorCode"] == 'page-not-found' && err['message'].include?('max page is') }
306
309
  raise MaxPageReached
307
310
  else
308
- raise Error.new result
311
+ raise Error.new(result)
309
312
  end
310
313
  end
311
314
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoptet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.41
4
+ version: 0.0.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Premysl Donat
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-18 00:00:00.000000000 Z
11
+ date: 2021-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: irb
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  - !ruby/object:Gem::Version
65
65
  version: '0'
66
66
  requirements: []
67
- rubygems_version: 3.2.21
67
+ rubygems_version: 3.2.29
68
68
  signing_key:
69
69
  specification_version: 4
70
70
  summary: API wrapper for interacting with Shoptet api