Skip to content

Commit f55d263

Browse files
authored
Raise admin not found error (#457)
1 parent 8a89cb6 commit f55d263

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/intercom/errors.rb

+3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ class ServiceConnectionError < IntercomError; end
5151
# Raised when requesting resources on behalf of a user that doesn't exist in your application on Intercom.
5252
class ResourceNotFound < IntercomError; end
5353

54+
# Raised when requesting an admin that doesn't exist in your Intercom workspace.
55+
class AdminNotFound < IntercomError; end
56+
5457
# Raised when trying to create a resource that already exists in Intercom.
5558
class ResourceNotUniqueError < IntercomError; end
5659

lib/intercom/request.rb

+2
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ def raise_application_errors_on_failure(error_list_details, http_code)
168168
raise Intercom::BlockedUserError.new(error_details['message'], error_context)
169169
when "not_found"
170170
raise Intercom::ResourceNotFound.new(error_details['message'], error_context)
171+
when "admin_not_found"
172+
raise Intercom::AdminNotFound.new(error_details['message'], error_context)
171173
when "rate_limit_exceeded"
172174
raise Intercom::RateLimitExceeded.new(error_details['message'], error_context)
173175
when "custom_data_limit_reached"

0 commit comments

Comments
 (0)