marketplace-kit 0.2.3 → 0.2.4

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
  SHA1:
3
- metadata.gz: 965c2610386b1ea7b538bd7ab4dcc2c9166090a6
4
- data.tar.gz: fb4e120590600721fea14f7165fdf2944f5658fb
3
+ metadata.gz: 51d15c3765dfe26a9ee047589c638ac20ebb2ce7
4
+ data.tar.gz: 63e55f6a68a6998d50ba2d93fad2561bb1275def
5
5
  SHA512:
6
- metadata.gz: a3c4343e23062f900fb4d12ac2d09865df2c0e5778c7163540309a8c70657c53eb1ebf65c84063217dc14430e7f15f955790499cefa79cf7bd1ea19b8e437763
7
- data.tar.gz: 11fedeb439692bd884b598c304815e739df8145e4b4e2e9da8c574e167776a0c53ed0bc630e7aba40a117152b3e7360f0d70007b838b2a7462203d7f0e8658ee
6
+ metadata.gz: 9328ca3764845e2e928a200191cf3d6d4c651679dd4c24e401f7e082ed896eed0203cd1e6a09691b8e084896ffbd143f88641f62ce59721c4aa7290870aaf6ff
7
+ data.tar.gz: 69f72e969b6918b44cb904f96a23ee2c2989226eb9a66b2883f013610ca448997e111cca362bc87d8dd1b9db1ff2365d3c3cf5956eb95350072bd51da44687ca
@@ -7,6 +7,18 @@ module MarketplaceKit
7
7
  @parsed_response = parsed_response
8
8
  super('Invalid API response!')
9
9
  end
10
+
11
+ def message
12
+ @parsed_response['error'] || meta_message
13
+ end
14
+
15
+ def meta_message
16
+ @parsed_response['meta']['message'] if @parsed_response['meta']
17
+ end
18
+
19
+ def details
20
+ @parsed_response['details']
21
+ end
10
22
  end
11
23
  end
12
24
  end
@@ -30,7 +30,7 @@ module MarketplaceKit
30
30
  if error.is_a?(JSON::ParserError)
31
31
  log :json_error, response.body
32
32
  elsif error.is_a?(Errors::ApiError)
33
- log :api_error, error.parsed_response['error'], error.parsed_response['details']
33
+ log :api_error, error.message, error.details
34
34
  else
35
35
  log :standard_error, error
36
36
  end
@@ -78,7 +78,7 @@ module MarketplaceKit
78
78
  def api_error(message, details)
79
79
  puts '```'.red
80
80
  puts "Builder error: #{message}".red
81
- puts 'Details:'
81
+ puts 'Details:' if details
82
82
  puts details
83
83
  puts '```'.red
84
84
  end
@@ -1,3 +1,3 @@
1
1
  module MarketplaceKit
2
- VERSION = '0.2.3'.freeze
2
+ VERSION = '0.2.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marketplace-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Janeczek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-13 00:00:00.000000000 Z
11
+ date: 2018-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler