intercom 2.2.3 → 2.2.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 +2 -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_spec.rb +5 -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: 7fa96a0842530f56baae6d4a78782fc99dbdfb5d
|
4
|
+
data.tar.gz: aab9881adb19557ed2e03d2edf4e8007aa5e7c18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46ff0d47d1be82494ab2b76b2ed90a73798f7e9465634e19e305495b7b27fd9c8887364906a0ecca0bc63267b2fb8ac2b7c4610ab0e302fd4b3a90b2729ea263
|
7
|
+
data.tar.gz: 4e47ecae6dea2a440d4580b7597ce91ec471d01f51f2f426ba043267a95a236964f0723735884b9b5c96b7c1517f5e932c464dad4de565941285f693020eaceb
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@ Additionally, the new version uses Ruby 2.
|
|
19
19
|
|
20
20
|
Using bundler:
|
21
21
|
|
22
|
-
gem 'intercom', "~> 2.2.
|
22
|
+
gem 'intercom', "~> 2.2.4"
|
23
23
|
|
24
24
|
## Basic Usage
|
25
25
|
|
@@ -342,6 +342,7 @@ Intercom::ResourceNotFound
|
|
342
342
|
Intercom::BadRequestError
|
343
343
|
Intercom::RateLimitExceeded
|
344
344
|
Intercom::AttributeNotSetError # Raised when you try to call a getter that does not exist on an object
|
345
|
+
Intercom::MultipleMatchingUsersError
|
345
346
|
```
|
346
347
|
|
347
348
|
### Rate Limiting
|
data/changes.txt
CHANGED
data/lib/intercom/errors.rb
CHANGED
@@ -37,6 +37,9 @@ module Intercom
|
|
37
37
|
|
38
38
|
# Raised when the request throws an error not accounted for
|
39
39
|
class UnexpectedError < IntercomError; end
|
40
|
+
|
41
|
+
# Raised when multiple users match the query (typically duplicate email addresses)
|
42
|
+
class MultipleMatchingUsersError < IntercomError; end
|
40
43
|
|
41
44
|
# Raised when you try to call a non-setter method that does not exist on an object
|
42
45
|
class Intercom::AttributeNotSetError < IntercomError ; end
|
data/lib/intercom/request.rb
CHANGED
@@ -127,6 +127,8 @@ module Intercom
|
|
127
127
|
raise Intercom::RateLimitExceeded.new(error_details['message'], error_context)
|
128
128
|
when 'service_unavailable'
|
129
129
|
raise Intercom::ServiceUnavailableError.new(error_details['message'], error_context)
|
130
|
+
when 'conflict'
|
131
|
+
raise Intercom::MultipleMatchingUsersError.new(error_details['message'], error_context)
|
130
132
|
when nil, ''
|
131
133
|
raise Intercom::UnexpectedError.new(message_for_unexpected_error_without_type(error_details, parsed_http_code), error_context)
|
132
134
|
else
|
data/lib/intercom/version.rb
CHANGED
data/spec/unit/intercom_spec.rb
CHANGED
@@ -16,6 +16,11 @@ describe Intercom do
|
|
16
16
|
Intercom.app_api_key = nil
|
17
17
|
proc { Intercom.target_base_url }.must_raise ArgumentError, "You must set both Intercom.app_id and Intercom.app_api_key to use this client. See https://github.com/intercom/intercom-ruby for usage examples."
|
18
18
|
end
|
19
|
+
|
20
|
+
it 'raises an Intercom::MultipleMatchingUsers error when receiving a conflict' do
|
21
|
+
multiple_matching_error = { 'type' => 'error.list', 'errors' => [{ 'code' => 'conflict', 'message' => 'Multiple existing users match this email address - must be more specific using user_id' }]}
|
22
|
+
proc {Intercom::Request.new('/users', :get).raise_application_errors_on_failure(multiple_matching_error, 400)}.must_raise(Intercom::MultipleMatchingUsersError)
|
23
|
+
end
|
19
24
|
|
20
25
|
it "returns the app_id and app_api_key previously set" do
|
21
26
|
Intercom.app_id.must_equal "abc123"
|
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: 2.2.
|
4
|
+
version: 2.2.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: 2014-10-
|
18
|
+
date: 2014-10-10 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: minitest
|