datasift 3.7.0 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/VERSION +1 -1
- data/lib/datasift.rb +11 -1
- data/lib/errors.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ba6751afecf874d13f2de17e8c27efed61693d9
|
4
|
+
data.tar.gz: 2a4d7e76cd1b84214e66f4f252e4608401389845
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4d5ab192c4a5663021854de9081eb602c4efde77731792160b9922cd8f608001d8c43d604e6f33b95688b7e799595b088f13002183f4d9a85e4755f1f7533c9
|
7
|
+
data.tar.gz: 3f54eee95ed7329d8fd3f46250859e8c36e06c0c5c7bdaea7c08993197160fb0f3dce8e48ebc02a1c9c87b8266469e38b0fddee9199cc4bd68d5c82a8729437d
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,12 @@ CHANGELOG
|
|
7
7
|
* Designed to make the most of DataSift's latest API version and features
|
8
8
|
* Designed for Ruby 2.3+. Use features like keyword parameters across the board
|
9
9
|
|
10
|
+
## v.3.7.1 (2016-10-06)
|
11
|
+
### Added
|
12
|
+
* Explicit support for 500 and 502 responses from the API
|
13
|
+
### Fixes
|
14
|
+
* Resolves [#86](https://github.com/datasift/datasift-ruby/issues/86); not handling 502 responses well
|
15
|
+
|
10
16
|
## v.3.7.0 (2016-08-04)
|
11
17
|
### Added
|
12
18
|
* Support for an `analyze_queries` parameter for Account Identity Limits
|
@@ -27,6 +33,12 @@ CHANGELOG
|
|
27
33
|
* Support for the [/pylon/update](http://dev.datasift.com/docs/platform/api/rest-api/endpoints/pylonupdate) API endpoint
|
28
34
|
* Support for [API v1.3](http://dev.datasift.com/docs/platform/api/api-changelog)
|
29
35
|
|
36
|
+
## v.3.5.1 (2016-10-06)
|
37
|
+
### Added
|
38
|
+
* Explicit support for 500 and 502 responses from the API
|
39
|
+
### Fixes
|
40
|
+
* Resolves [#86](https://github.com/datasift/datasift-ruby/issues/86); not handling 502 responses well
|
41
|
+
|
30
42
|
## v.3.5.0 (2015-11-13)
|
31
43
|
### Added
|
32
44
|
* Support for the `/account/usage` API endpoint
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.7.
|
1
|
+
3.7.1
|
data/lib/datasift.rb
CHANGED
@@ -230,8 +230,14 @@ module DataSift
|
|
230
230
|
begin
|
231
231
|
code = e.http_code
|
232
232
|
body = e.http_body
|
233
|
+
error = nil
|
233
234
|
if code && body
|
234
|
-
|
235
|
+
begin
|
236
|
+
error = MultiJson.load(body)
|
237
|
+
rescue MultiJson::ParseError
|
238
|
+
# In cases where we receive 502 responses, Nginx may send HTML rather than JSON
|
239
|
+
error = body
|
240
|
+
end
|
235
241
|
response_on_error = {
|
236
242
|
:data => nil,
|
237
243
|
:datasift => {
|
@@ -303,6 +309,10 @@ module DataSift
|
|
303
309
|
raise UnprocessableEntityError.new(code, body, response)
|
304
310
|
when 429
|
305
311
|
raise TooManyRequestsError.new(code, body, response)
|
312
|
+
when 500
|
313
|
+
raise InternalServerError.new(code, body, response)
|
314
|
+
when 502
|
315
|
+
raise BadGatewayError.new(code, body, response)
|
306
316
|
when 503
|
307
317
|
raise ServiceUnavailableError.new(code, body, response)
|
308
318
|
when 504
|
data/lib/errors.rb
CHANGED
@@ -68,6 +68,14 @@ end
|
|
68
68
|
class TooManyRequestsError < DataSiftError
|
69
69
|
end
|
70
70
|
|
71
|
+
# Standard error returned when receiving a 500 response from the API
|
72
|
+
class InternalServerError < DataSiftError
|
73
|
+
end
|
74
|
+
|
75
|
+
# Standard error returned when receiving a 502 response from the API
|
76
|
+
class BadGatewayError < DataSiftError
|
77
|
+
end
|
78
|
+
|
71
79
|
# Standard error returned when receiving a 503 response from the API
|
72
80
|
class ServiceUnavailableError < DataSiftError
|
73
81
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datasift
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.7.
|
4
|
+
version: 3.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DataSift
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-10-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rest-client
|