wavefront-sdk 2.5.0 → 2.5.1

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: b70702ec3f4199746297f9cae5d0f3d2c5158761d6cef25b662964731200c194
4
- data.tar.gz: a4a43f7af561ee87f9e1479e98441d5db7a9a319ed5e26fcaf61bfb461c888e5
3
+ metadata.gz: 42ae7285512a6926765e9db64a2af0f21927864655acf1a708138e8e2122dbcf
4
+ data.tar.gz: 0a05d21b257accb683c08f768cb4d8e33fbd93dfe625e8cfb59ade6e8b766641
5
5
  SHA512:
6
- metadata.gz: 202a64ad28993dbc87e1e5aa3533d2f28634febf7986ef4b0e46c884d9ccd662e31870a563d4950ef930d937ac25ca2611005ff5ff2e9c045b4c850ab519eb18
7
- data.tar.gz: 4d5f91ce8d84fca57067278619723777f219ec2129b1c04e8d93bcf8db96d8175ecc386b7f078450c76fa701fbf069fdd2a7a95d313acb5e03b119cb4dfbae2e
6
+ metadata.gz: e46a38fae37d192440ebc417dba659fab395788b7ee644bb30d31cd90951e58c5748fad3bff100170ae6babbc4fdadbc1a623810d6f0ca93397f470bfeb14118
7
+ data.tar.gz: bca0a1ac53c6556f756f5ac5dc195986a180e0fbb78ebc423b37151c000421c29c21bb0fe032dfc59debd700c53d83c66f9cac08bebb26a91059cf848683bbe1
data/HISTORY.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.5.1 (06/03/2019)
4
+ * Fix messy handling of raw query errors.
5
+
3
6
  ## 2.5.0 (21/02/2019)
4
7
  * New `Wavefront::UserGroup` class, for new API `UserGroup` feature.
5
8
  * Extended `Wavefront::User` to cover new API methods.
@@ -28,7 +31,6 @@
28
31
  * Full `Wavefront::Alert` test coverage.
29
32
 
30
33
  ## 2.2.0 (15/12/2018)
31
-
32
34
  * New methods to cover new API paths.
33
35
  * `Wavefront::Alert#install`,
34
36
  * `Wavefront::Alert#uninstall`,
@@ -1 +1 @@
1
- WF_SDK_VERSION = '2.5.0'.freeze
1
+ WF_SDK_VERSION = '2.5.1'.freeze
@@ -77,10 +77,21 @@ module Wavefront
77
77
  # paths. The default response is a single array.
78
78
  #
79
79
  def response_shim(body, status)
80
- { response: JSON.parse(body),
80
+ resp, err_msg = parsed_response(body)
81
+
82
+ { response: resp,
81
83
  status: { result: status == 200 ? 'OK' : 'ERROR',
82
- message: '',
84
+ message: err_msg,
83
85
  code: status } }.to_json
84
86
  end
87
+
88
+ # A bad query doesn't send back a JSON object. It sends back a
89
+ # string with an embedded message.
90
+ #
91
+ def parsed_response(body)
92
+ [JSON.parse(body), '']
93
+ rescue JSON::ParserError
94
+ ['', body.match(/message='([^']+)'/).captures.first]
95
+ end
85
96
  end
86
97
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wavefront-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Fisher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-23 00:00:00.000000000 Z
11
+ date: 2019-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -311,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
311
311
  - !ruby/object:Gem::Version
312
312
  version: '0'
313
313
  requirements: []
314
- rubygems_version: 3.0.2
314
+ rubygems_version: 3.0.3
315
315
  signing_key:
316
316
  specification_version: 4
317
317
  summary: SDK for Wavefront API v2