Skip to content

Commit b814078

Browse files
committed
Add CDA Limit Reached Error handling
1 parent 8541b68 commit b814078

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/intercom/errors.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ class RateLimitExceeded < IntercomError; end
6363
# Raised when the request throws an error not accounted for
6464
class UnexpectedError < IntercomError; end
6565

66+
# Raised when the CDA limit for the app has been reached
67+
class CDALimitReachedError < IntercomError; end
68+
6669
# Raised when multiple users match the query (typically duplicate email addresses)
6770
class MultipleMatchingUsersError < IntercomError; end
6871

lib/intercom/request.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ def raise_application_errors_on_failure(error_list_details, http_code)
170170
raise Intercom::ResourceNotFound.new(error_details['message'], error_context)
171171
when "rate_limit_exceeded"
172172
raise Intercom::RateLimitExceeded.new(error_details['message'], error_context)
173+
when "custom_data_limit_reached"
174+
raise Intercom::CDALimitReachedError.new(error_details['message'], error_context)
173175
when 'service_unavailable'
174176
raise Intercom::ServiceUnavailableError.new(error_details['message'], error_context)
175177
when 'conflict', 'unique_user_constraint'

0 commit comments

Comments
 (0)