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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9514742754e640586396259bf46db4ef3a714a99cc3c55dd0281690f8cd852a8
4
- data.tar.gz: d46865ec68613a926a59d7a224ad9d4fa45acb89f8a07073621ea808cbc1be84
3
+ metadata.gz: d9ca1c1ca1b1277e8c80a0541670ed13d23609011347c19f89cbc0a9a155b393
4
+ data.tar.gz: 7dd6a7ad64155b4fb4ac2ca2df5c957e9215e257a91b58c59698694e27724515
5
5
  SHA512:
6
- metadata.gz: cd946dd81fda3ccf0ba5cd61010c2fe2ccbe1aa6e4d1d38b762676112c31a00a0e9b9c551d389ceec68a425a8e736f1deabadedb9349d0a1792b45cf3969c0be
7
- data.tar.gz: 965dcbeceeac83b34f50fa6762fc0c62d406e600ca7a25476a48044782ccefb591925feff9475c95745e31bdcb38ec00533ae7384d0ad22e7d170b2bb0a0c1dc
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, "API request failed: #{http_body.inspect} (HTTP response code was #{http_status})"
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; end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: treezor_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - stefakins