pusher-platform 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pusher-platform/base_client.rb +2 -2
- data/lib/pusher-platform/error_response.rb +4 -4
- 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: 32291000abdb919cc500b2056087a82cbfaa89ff
|
4
|
+
data.tar.gz: 4af86b24dd738937da180c700de4f9fa9c6b57b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c29aac90982c3b4e4785df785a7a96a50749bfee6d74358ab487b18349afc0d9dd776e6913638fd4db396ee56a77a987cbbf6bd7becf548872ee817ea21d3ff
|
7
|
+
data.tar.gz: ff4514658c6d3adbb70b02e260857c8468423cb97def7d7b6bb5797e61cef7e7ebd6a4ee795ed173a25cc5b7a01049eb1443a3773c5d23b15eba436680e51cb7
|
@@ -34,12 +34,12 @@ module Pusher
|
|
34
34
|
elsif response.status >= 300 && response.status <= 399
|
35
35
|
raise "unsupported redirect response: #{response.status}"
|
36
36
|
elsif response.status >= 400 && response.status <= 599
|
37
|
-
|
37
|
+
error_description = begin
|
38
38
|
JSON.parse(response.body)
|
39
39
|
rescue
|
40
40
|
response.body
|
41
41
|
end
|
42
|
-
raise ErrorResponse.new(response.status, response.headers,
|
42
|
+
raise ErrorResponse.new(response.status, response.headers, error_description)
|
43
43
|
else
|
44
44
|
raise "unsupported response code: #{response.status}"
|
45
45
|
end
|
@@ -1,15 +1,15 @@
|
|
1
1
|
module Pusher
|
2
2
|
class ErrorResponse < Error
|
3
|
-
attr_accessor :status, :headers, :
|
3
|
+
attr_accessor :status, :headers, :description
|
4
4
|
|
5
|
-
def initialize(status, headers,
|
5
|
+
def initialize(status, headers, description)
|
6
6
|
@status = status
|
7
7
|
@headers = headers
|
8
|
-
@
|
8
|
+
@description = description
|
9
9
|
end
|
10
10
|
|
11
11
|
def to_s
|
12
|
-
"Pusher::ErrorResponse: #{status} #{
|
12
|
+
"Pusher::ErrorResponse: #{status} #{description}"
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pusher-platform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pusher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|