Exception: Intercom::IntercomError
- Inherits:
-
StandardError
- Object
- StandardError
- Intercom::IntercomError
- Defined in:
- lib/intercom/errors.rb
Overview
Base class exception from which all public Intercom exceptions will be derived
Direct Known Subclasses
AdminNotFound, ApiVersionInvalid, AttributeNotSetError, AuthenticationError, BadGatewayError, BadRequestError, BlockedUserError, CDALimitReachedError, GatewayTimeoutError, HttpError, InvalidDocumentError, InvalidMergeError, MultipleMatchingUsersError, RateLimitExceeded, ResourceNotFound, ResourceNotUniqueError, ScrollAlreadyExistsError, ServerError, ServiceConnectionError, ServiceUnavailableError, TagHasDependentObjects, UnexpectedError, UnexpectedResponseError
Instance Attribute Summary collapse
-
#application_error_code ⇒ Object
readonly
Returns the value of attribute application_error_code.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#http_code ⇒ Object
readonly
Returns the value of attribute http_code.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
Instance Method Summary collapse
-
#initialize(message, context = {}) ⇒ IntercomError
constructor
A new instance of IntercomError.
- #inspect ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(message, context = {}) ⇒ IntercomError
Returns a new instance of IntercomError.
6 7 8 9 10 11 12 |
# File 'lib/intercom/errors.rb', line 6 def initialize(, context={}) @http_code = context[:http_code] @application_error_code = context[:application_error_code] @field = context[:field] @request_id = context[:request_id] super() end |
Instance Attribute Details
#application_error_code ⇒ Object (readonly)
Returns the value of attribute application_error_code.
5 6 7 |
# File 'lib/intercom/errors.rb', line 5 def application_error_code @application_error_code end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
5 6 7 |
# File 'lib/intercom/errors.rb', line 5 def field @field end |
#http_code ⇒ Object (readonly)
Returns the value of attribute http_code.
5 6 7 |
# File 'lib/intercom/errors.rb', line 5 def http_code @http_code end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
5 6 7 |
# File 'lib/intercom/errors.rb', line 5 def request_id @request_id end |
Instance Method Details
#inspect ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/intercom/errors.rb', line 13 def inspect attributes = instance_variables.map do |var| value = instance_variable_get(var).inspect "#{var}=#{value}" end "##{self.class.name}:#{} #{attributes.join(' ')}" end |
#to_hash ⇒ Object
20 21 22 23 |
# File 'lib/intercom/errors.rb', line 20 def to_hash {message: } .merge(Hash[instance_variables.map{ |var| [var[1..-1], instance_variable_get(var)] }]) end |