brightpearl_api 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/brightpearl_api/client.rb +8 -0
- data/lib/brightpearl_api/version.rb +1 -1
- data/lib/brightpearl_api.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1f41a5dc70a62f5e425374b3583af15ca850ed0
|
4
|
+
data.tar.gz: 5be578c8a9d7ca90a8df8e1cdfd9c9d6c21beafd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fd12c22e777a5070a5882fa08c058a6a7355c117d3647ec36bb9b246c69c41db0bffdd489f9ca9fc7e8c638466ca4c459a4bce7e6736aa71e565c4737daa459
|
7
|
+
data.tar.gz: 07894fd31d3ddbb8ca99e7d54bd55d41b00e5d433653497f421fb97d1ca131734afa40123425f7802750b25469662c9ab223824191d28689921a183437afc036
|
@@ -21,6 +21,9 @@ module BrightpearlApi
|
|
21
21
|
sleep(60.seconds)
|
22
22
|
reset_token
|
23
23
|
api_call(type, path, data)
|
24
|
+
rescue DatabaseException => e
|
25
|
+
sleep(1.seconds)
|
26
|
+
api_call(type, path, data)
|
24
27
|
end
|
25
28
|
|
26
29
|
def api_call(type, path, data = {})
|
@@ -85,6 +88,11 @@ module BrightpearlApi
|
|
85
88
|
def check_response(response)
|
86
89
|
if(!response['errors'].blank?)
|
87
90
|
reset_token
|
91
|
+
if response['errors'].is_a? Array
|
92
|
+
if response['errors'][0].fetch('message', '').include? 'Could not create connection to database server'
|
93
|
+
raise DatabaseException, "#{response.to_json}"
|
94
|
+
end
|
95
|
+
end
|
88
96
|
raise BrightpearlException, "#{response.to_json}"
|
89
97
|
end
|
90
98
|
if (response['response'].is_a? String) && (response['response'].include? 'Not authenticated')
|
data/lib/brightpearl_api.rb
CHANGED
@@ -12,6 +12,7 @@ module BrightpearlApi
|
|
12
12
|
class AuthException < StandardError; end
|
13
13
|
class BrightpearlException < StandardError; end
|
14
14
|
class ThrottleException < StandardError; end
|
15
|
+
class DatabaseException < StandardError; end
|
15
16
|
|
16
17
|
def self.configure
|
17
18
|
Configuration.instance.init
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brightpearl_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kunwar Aditya Raghuwanshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|