domoscio_rails 0.3.1 → 0.3.2
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 +4 -4
- data/lib/domoscio_rails.rb +4 -4
- data/lib/domoscio_rails/errors.rb +7 -7
- data/lib/domoscio_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7de15318619ac60add7c2ebeb2157708e3a5df0256f3dcb0773631b4dd7dc256
|
4
|
+
data.tar.gz: 149d4a92db05a3c93feb9cbc5121d3b56773957e36585643ad477908ada0f6c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76d276424eb7a5863cd5f657e85e6d37a550cb04dece402c84a3965b1ab2b0254d7a2a17361ada6e60ff01cb5273f8d043d01aba95992fd5587cc2af9841c435
|
7
|
+
data.tar.gz: 7607882ea4f08fef22593bdc691f770dc6c791cf3034a416b09473882c73762b70e3b78169f11f931c953f64adaf8ecab54f255b643e0382e6ff472274f2d32a
|
data/lib/domoscio_rails.rb
CHANGED
@@ -110,12 +110,12 @@ module DomoscioRails
|
|
110
110
|
begin
|
111
111
|
unless res.kind_of? Net::HTTPSuccess
|
112
112
|
data = DomoscioRails::JSON.load((res.body.nil? ? '' : res.body), :symbolize_keys => true)
|
113
|
-
raise ResponseError.new(uri, res.code.to_i, data, res.body)
|
113
|
+
raise ResponseError.new(uri, res.code.to_i, data, res.body, params)
|
114
114
|
end
|
115
115
|
data = DomoscioRails::JSON.load(res.body.nil? ? '' : res.body)
|
116
116
|
DomoscioRails::AuthorizationToken::Manager.storage.store({access_token: res['Accesstoken'], refresh_token: res['Refreshtoken']})
|
117
117
|
rescue MultiJson::LoadError => exception
|
118
|
-
data = ProcessingError.new(uri, 500, exception, res.body)
|
118
|
+
data = ProcessingError.new(uri, 500, exception, res.body, params)
|
119
119
|
rescue ResponseError => exception
|
120
120
|
data = exception
|
121
121
|
end
|
@@ -128,13 +128,13 @@ module DomoscioRails
|
|
128
128
|
begin
|
129
129
|
unless res.kind_of? Net::HTTPSuccess
|
130
130
|
body = DomoscioRails::JSON.load((res.body.nil? ? '' : res.body), :symbolize_keys => true)
|
131
|
-
raise ResponseError.new(uri, res.code.to_i, body, res.body)
|
131
|
+
raise ResponseError.new(uri, res.code.to_i, body, res.body, params)
|
132
132
|
end
|
133
133
|
body = DomoscioRails::JSON.load(res.body.nil? ? '' : res.body)
|
134
134
|
data += body
|
135
135
|
data.flatten!
|
136
136
|
rescue MultiJson::LoadError => exception
|
137
|
-
return ProcessingError.new(uri, 500, exception, res.body)
|
137
|
+
return ProcessingError.new(uri, 500, exception, res.body, params)
|
138
138
|
rescue ResponseError => exception
|
139
139
|
return exception
|
140
140
|
end
|
@@ -5,19 +5,19 @@ module DomoscioRails
|
|
5
5
|
|
6
6
|
# Error Message from AdaptiveEngine
|
7
7
|
class ResponseError < Error
|
8
|
-
attr_reader :request_url, :code, :details, :body
|
9
|
-
def initialize(request_url, code, details, body)
|
10
|
-
@request_url, @code, @details, @body = request_url, code, details, body
|
8
|
+
attr_reader :request_url, :code, :details, :body, :request_params
|
9
|
+
def initialize(request_url, code, details, body, request_params)
|
10
|
+
@request_url, @code, @details, @body, @request_params = request_url, code, details, body, request_params
|
11
11
|
super(message) if message
|
12
12
|
end
|
13
13
|
def message; @details.dig(:error, :message) || @details; end
|
14
14
|
end
|
15
15
|
|
16
|
-
#
|
16
|
+
# ProcessingError from DomoscioRails
|
17
17
|
class ProcessingError < Error
|
18
|
-
attr_reader :request_url, :code, :details, :body
|
19
|
-
def initialize(request_url, code, details, body)
|
20
|
-
@request_url, @code, @details, @body = request_url, code, details, body
|
18
|
+
attr_reader :request_url, :code, :details, :body, :request_params
|
19
|
+
def initialize(request_url, code, details, body, request_params)
|
20
|
+
@request_url, @code, @details, @body, @request_params = request_url, code, details, body, request_params
|
21
21
|
super(message) if message
|
22
22
|
end
|
23
23
|
def message; @details.message; end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: domoscio_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benoit Praly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|