intercom 3.9.3 → 3.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/changes.txt +3 -0
- data/lib/intercom/errors.rb +3 -0
- data/lib/intercom/request.rb +2 -0
- data/lib/intercom/version.rb +1 -1
- data/spec/unit/intercom/request_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e91491f3bc68beec6be9a2fa595d446aabc7a8ab62127d54f204325c20a19c8e
|
4
|
+
data.tar.gz: d14661974dddeb5dc385cbb739c856bccd0809f93e01af10d14f6ae3464c8d44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb94e199bca968f5976ee9036b8bfc17fe93ce386464715eb047de220203c3139607bb8f39e23a160193ab136ca2f1dcd631f976362a3cb1fc75ca799605ddfc
|
7
|
+
data.tar.gz: 3b447a5a048ae09870119d15412359dcf041560c787753ca84d16f76368e818b8255da0199fef1a7da82b4dac3a68c1808c2dcaa2bd3952c32956e9308c09173
|
data/README.md
CHANGED
data/changes.txt
CHANGED
data/lib/intercom/errors.rb
CHANGED
@@ -42,6 +42,9 @@ module Intercom
|
|
42
42
|
# Raised when we have bad gateway errors.
|
43
43
|
class BadGatewayError < IntercomError; end
|
44
44
|
|
45
|
+
# Raised when we have gateway timeout errors.
|
46
|
+
class GatewayTimeoutError < IntercomError; end
|
47
|
+
|
45
48
|
# Raised when we experience a socket read timeout
|
46
49
|
class ServiceUnavailableError < IntercomError; end
|
47
50
|
|
data/lib/intercom/request.rb
CHANGED
@@ -168,6 +168,8 @@ module Intercom
|
|
168
168
|
raise Intercom::BadGatewayError.new('Bad Gateway Error')
|
169
169
|
elsif code == 503
|
170
170
|
raise Intercom::ServiceUnavailableError.new('Service Unavailable')
|
171
|
+
elsif code == 504
|
172
|
+
raise Intercom::GatewayTimeoutError.new('Gateway Timeout')
|
171
173
|
end
|
172
174
|
end
|
173
175
|
|
data/lib/intercom/version.rb
CHANGED
@@ -109,6 +109,15 @@ describe 'Intercom::Request', '#execute' do
|
|
109
109
|
|
110
110
|
expect { execute! }.must_raise(Intercom::RateLimitExceeded)
|
111
111
|
end
|
112
|
+
|
113
|
+
it 'raises a GatewayTimeoutError error when the response code is 504' do
|
114
|
+
stub_request(:any, uri).to_return(
|
115
|
+
status: 504,
|
116
|
+
body: '<html> <head><title>504 Gateway Time-out</title></head> <body bgcolor="white"> <center><h1>504 Gateway Time-out</h1></center> </body> </html>'
|
117
|
+
)
|
118
|
+
|
119
|
+
expect { execute! }.must_raise(Intercom::GatewayTimeoutError)
|
120
|
+
end
|
112
121
|
end
|
113
122
|
|
114
123
|
describe "application error handling" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intercom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.9.
|
4
|
+
version: 3.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben McRedmond
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2019-11-
|
18
|
+
date: 2019-11-12 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: minitest
|