Exception: Ovh::Http2sms::ResponseParseError

Inherits:
Error
  • Object
show all
Defined in:
lib/ovh/http2sms/errors.rb

Overview

Raised when the API response cannot be parsed

Examples:

raise ResponseParseError.new("Invalid JSON", raw_response: "not json")

Instance Attribute Summary collapse

Attributes inherited from Error

#raw_response, #status_code

Instance Method Summary collapse

Constructor Details

#initialize(message = "Failed to parse API response", content_type: nil, **options) ⇒ ResponseParseError

Returns a new instance of ResponseParseError.



142
143
144
145
# File 'lib/ovh/http2sms/errors.rb', line 142

def initialize(message = "Failed to parse API response", content_type: nil, **options)
  @content_type = content_type
  super(message, **options)
end

Instance Attribute Details

#content_typeString? (readonly)

Returns The content type that failed to parse.

Returns:

  • (String, nil)

    The content type that failed to parse



140
141
142
# File 'lib/ovh/http2sms/errors.rb', line 140

def content_type
  @content_type
end