lib/submodules/ably-ruby/lib/ably/models/error_info.rb in ably-rest-1.1.7 vs lib/submodules/ably-ruby/lib/ably/models/error_info.rb in ably-rest-1.1.8
- old
+ new
@@ -25,10 +25,14 @@
# @return [String] Additional reason information, where available
# @!attribute [r] code
# @return [Integer] Ably error code (see ably-common/protocol/errors.json)
# @!attribute [r] status
# @return [Integer] HTTP Status Code corresponding to this error, where applicable
+ # @!attribute [r] request_id
+ # @return [Integer] HTTP RequestId corresponding to this error, where applicable (#RSC7c)
+ # @!attribute [r] cause
+ # @return [Integer] HTTP Status Code corresponding to this error, where applicable (#TI1)
# @!attribute [r] attributes
# @return [Hash] Access the protocol message Hash object ruby'fied to use symbolized keys
#
class ErrorInfo < Ably::Exceptions::BaseAblyException
include Ably::Modules::ModelCommon
@@ -36,11 +40,11 @@
def initialize(hash_object)
@raw_hash_object = hash_object
@hash_object = IdiomaticRubyWrapper(hash_object.clone.freeze)
end
- %w(message code href status_code).each do |attribute|
+ %w(message code href status_code request_id cause).each do |attribute|
define_method attribute do
attributes[attribute.to_sym]
end
end
alias_method :status, :status_code
@@ -50,9 +54,9 @@
end
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})>#{see_msg}"
+ "<Error: #{message} (code: #{code}, http status: #{status} request_id: #{request_id} cause: #{cause})>#{see_msg}"
end
end
end