Skip to content

Commit 23f29ef

Browse files
author
Devin McGloin
authored
Merge pull request #462 from intercom/dtm/scroll-error
Added error handling for scroll existing already
2 parents 1a7ab5b + 34bc972 commit 23f29ef

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
@@ -84,6 +84,9 @@ class Intercom::HttpError < IntercomError; end
8484
# Raised when an invalid api version is used
8585
class ApiVersionInvalid < IntercomError; end
8686

87+
# Raised when an creating a scroll if one already exists
88+
class ScrollAlreadyExistsError < IntercomError; end
89+
8790
#
8891
# Non-public errors (internal to the gem)
8992
#

lib/intercom/request.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ def raise_application_errors_on_failure(error_list_details, http_code)
187187
raise Intercom::ResourceNotUniqueError.new(error_details['message'], error_context)
188188
when 'intercom_version_invalid'
189189
raise Intercom::ApiVersionInvalid.new(error_details['message'], error_context)
190+
when 'scroll_exists'
191+
raise Intercom::ScrollAlreadyExistsError.new(error_details['message'], error_context)
190192
when nil, ''
191193
raise Intercom::UnexpectedError.new(message_for_unexpected_error_without_type(error_details, parsed_http_code), error_context)
192194
else

0 commit comments

Comments
 (0)