treezor_connect 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/treezor_connect/client.rb +5 -1
- data/lib/treezor_connect/errors.rb +10 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9ca1c1ca1b1277e8c80a0541670ed13d23609011347c19f89cbc0a9a155b393
|
4
|
+
data.tar.gz: 7dd6a7ad64155b4fb4ac2ca2df5c957e9215e257a91b58c59698694e27724515
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e95d83ed1cd19d96adbaae7218b5f40b74cb9c9e88cf22add9711a8425fd309372f8e6d59dc5cb58e7d8d993187cdca8815773753c16e065149befe8ad70302f
|
7
|
+
data.tar.gz: ae60758b4e780253c0b784bd8568d6e852dc420143b9d1f4bff75ff508e540befca9755de34c52aacf5b010a6b0301fe26fbf592c213a39b42d39956245cb7d3
|
@@ -41,7 +41,11 @@ module TreezorConnect
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def raise_api_error(http_status:, http_body:)
|
44
|
-
raise ApiError
|
44
|
+
raise ApiError.new(
|
45
|
+
"API request failed: #{http_body.inspect} (HTTP response code was #{http_status})",
|
46
|
+
http_body,
|
47
|
+
http_status
|
48
|
+
)
|
45
49
|
end
|
46
50
|
|
47
51
|
def token_expired?(token)
|
@@ -1,3 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class ApiError < StandardError
|
3
|
+
class ApiError < StandardError
|
4
|
+
attr_reader :errors, :status
|
5
|
+
|
6
|
+
def initialize(message = '', errors = {}, status = 0)
|
7
|
+
@errors = errors
|
8
|
+
@status = status
|
9
|
+
|
10
|
+
super(message)
|
11
|
+
end
|
12
|
+
end
|