telemetry 1.4.6 → 1.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/telemetry/api.rb +16 -14
- data/lib/telemetry/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: 488007c80f96a863ab6d8102b9eb2f6182ba826d
|
4
|
+
data.tar.gz: 659e8033ee00207ee035ae4f18788218e8f08e57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2f5f47aab4838188c526a5d985338f2555e439856992228a458d04fe9eaae4b8b75007c07fbb6b3f83cdd88983738c16df908869f0df088872f78c495c1968a
|
7
|
+
data.tar.gz: 21d7bd56904b07eda8423a40f289d15196c80fe04621a937c0477f888efd48214b52f8ec6bbc2919322c292cfbd519bea8ab968df24ff85c7b581ca18a78e61c
|
data/lib/telemetry/api.rb
CHANGED
@@ -192,7 +192,7 @@ module Telemetry
|
|
192
192
|
request['Content-Type'] = 'application/json'
|
193
193
|
request['Accept-Version'] = '~ 1'
|
194
194
|
request['User-Agent'] = "Telemetry Ruby Gem (#{Telemetry::TELEMETRY_VERSION})"
|
195
|
-
|
195
|
+
|
196
196
|
start_time = Time.now
|
197
197
|
|
198
198
|
begin
|
@@ -283,21 +283,23 @@ module Telemetry
|
|
283
283
|
|
284
284
|
def self.parse_response(response)
|
285
285
|
begin
|
286
|
-
|
287
|
-
return nil unless
|
286
|
+
resp_json = MultiJson.load(response.body)
|
287
|
+
return nil unless resp_json && (resp_json.is_a?(Hash) || resp_json.is_a?(Array))
|
288
288
|
|
289
|
-
if
|
290
|
-
|
291
|
-
|
289
|
+
if resp_json.is_a?(Hash)
|
290
|
+
if resp_json["errors"] && resp_json["errors"].is_a?(Array) && resp_json["errors"].count > 0
|
291
|
+
Telemetry::logger.error "Errors: #{resp_json['errors'].join(', ')}"
|
292
|
+
end
|
292
293
|
|
293
|
-
|
294
|
-
|
295
|
-
|
294
|
+
if resp_json["updated"] && resp_json["updated"].is_a?(Array) && resp_json["updated"].count > 0
|
295
|
+
Telemetry::logger.debug "Updated: #{resp_json['updated'].join(', ')}"
|
296
|
+
end
|
296
297
|
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
298
|
+
if resp_json["skipped"] && resp_json["skipped"].is_a?(Array) && resp_json["skipped"].count > 0
|
299
|
+
Telemetry::logger.error "Skipped: #{resp_json['skipped'].join(', ')}"
|
300
|
+
end
|
301
|
+
end
|
302
|
+
return resp_json
|
301
303
|
|
302
304
|
rescue Exception => e
|
303
305
|
return nil
|
@@ -314,7 +316,7 @@ module Telemetry
|
|
314
316
|
|
315
317
|
class AuthorizationError < Exception
|
316
318
|
end
|
317
|
-
|
319
|
+
|
318
320
|
class FlowNotFound < Exception
|
319
321
|
end
|
320
322
|
|
data/lib/telemetry/version.rb
CHANGED