essential 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/essential/errors/api_error.rb +5 -3
- data/lib/essential/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 295b7657588d2a1be35f1f74f663c11885979e5c
|
4
|
+
data.tar.gz: 3f61f6377dc13ca9ab38c30fe8ac8e3c633146cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7404fb9fb0d0a7ac1e97903264ba5e520a655e79fb1f90186dac7b6a265b314dddc47cc81fff7828509dc0bc00f222d5349edd88a067f5c2136966eae6f7b6a
|
7
|
+
data.tar.gz: 0e2008027043c94d50a4dd6d2d4dda51a28988f91c9a41837704fc086ca3d59df2f3d495a14ae871f72715215d9bd830a0f22039614ca635a5271242fdaf7422
|
@@ -2,7 +2,7 @@ module Essential
|
|
2
2
|
class APIError < StandardError
|
3
3
|
private_class_method :new
|
4
4
|
|
5
|
-
attr_reader :http_status, :body
|
5
|
+
attr_reader :http_status, :body, :response
|
6
6
|
attr_reader :type, :message, :code, :params
|
7
7
|
|
8
8
|
def self.from_exception(e)
|
@@ -12,7 +12,8 @@ module Essential
|
|
12
12
|
when RestClient::ExceptionWithResponse
|
13
13
|
new(
|
14
14
|
http_status: e.http_code,
|
15
|
-
body: e.http_body
|
15
|
+
body: e.http_body,
|
16
|
+
response: e.response
|
16
17
|
)
|
17
18
|
when RestClient::Exception
|
18
19
|
new(http_status: e.http_code)
|
@@ -22,8 +23,9 @@ module Essential
|
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
25
|
-
def initialize(http_status: nil, body: nil)
|
26
|
+
def initialize(http_status: nil, body: nil, response: nil)
|
26
27
|
@http_status = http_status
|
28
|
+
@response = response
|
27
29
|
|
28
30
|
if body
|
29
31
|
begin
|
data/lib/essential/version.rb
CHANGED