class Ably::Models::ErrorInfo
An exception type encapsulating error information containing an Ably-specific error code and generic status code.
Public Class Methods
Source
# File lib/ably/models/error_info.rb, line 28 def initialize(hash_object) @raw_hash_object = hash_object @hash_object = IdiomaticRubyWrapper(hash_object.clone.freeze) end
Public Instance Methods
Source
# File lib/ably/models/error_info.rb, line 69 def cause attributes[:cause] end
Information pertaining to what caused the error where available.
@spec TI1
@return [Ably::Models::ErrorInfo]
Source
# File lib/ably/models/error_info.rb, line 39 def code attributes[:code] end
Ably
error code.
@spec TI1
@return [Integer]
Source
# File lib/ably/models/error_info.rb, line 49 def href attributes[:href] end
This is included for REST responses to provide a URL for additional help on the error code.
@spec TI4
@return [String]
Source
# File lib/ably/models/error_info.rb, line 59 def message attributes[:message] end
Additional message information, where available.
@spec TI1
@return [String]
Source
# File lib/ably/models/error_info.rb, line 89 def request_id attributes[:request_id] end
If a request fails, the request ID must be included in the ErrorInfo
returned to the user.
@spec RSC7c
@return [String]
Source
# File lib/ably/models/error_info.rb, line 79 def status_code attributes[:status_code] end
HTTP Status Code corresponding to this error, where applicable.
@spec TI1
@return [Integer]
Also aliased as: status
Source
# File lib/ably/models/error_info.rb, line 98 def to_s error_href = href || (code ? "https://help.ably.io/error/#{code}" : '') see_msg = " -> see #{error_href} for help" unless message.to_s.include?(error_href.to_s) "<Error: #{message} (code: #{code}, http status: #{status} request_id: #{request_id} cause: #{cause})>#{see_msg}" end