intercom 2.2.3 → 2.2.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9e9fc89a1afe0812e99ba788f34abb10a2efee6
4
- data.tar.gz: 22a8b523d0118dca4f92f9429ddc046ab3126d1d
3
+ metadata.gz: 7fa96a0842530f56baae6d4a78782fc99dbdfb5d
4
+ data.tar.gz: aab9881adb19557ed2e03d2edf4e8007aa5e7c18
5
5
  SHA512:
6
- metadata.gz: 06825933a4db65f7ea657c6525bc350d9df83cb3ad84a5baf4bb7043f061f32ccd8d7480d8a0bbe73614dda861375f4bd990c80d140f5b6feb90b60bab99ea94
7
- data.tar.gz: f7059cecea4a6add02f0fcf1d28ea717a78829631393ed7f6d4e017e342e366da481affe6c9d4bf0aa95fa37f5d94f106f723126a30999f60e0594848d8c6e88
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.3"
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
@@ -1,3 +1,6 @@
1
+ 2.2.4
2
+ - Add Intercom::MultipleMatchingUsersError
3
+
1
4
  2.2.3
2
5
  - Add rate limiting details to Intercom.rate_limiting_details
3
6
 
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Intercom #:nodoc:
2
- VERSION = "2.2.3"
2
+ VERSION = "2.2.4"
3
3
  end
@@ -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.3
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-07 00:00:00.000000000 Z
18
+ date: 2014-10-10 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: minitest