Exception: ContextIO::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/context-io/error.rb

Overview

Base class for ContextIO exceptions.

Direct Known Subclasses

ClientError, ServerError

Defined Under Namespace

Classes: BadRequest, ClientError, Forbidden, InternalServerError, NotFound, PaymentRequired, ServerError, ServiceUnavailable, Unauthorized

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, http_headers) ⇒ Error

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initialize a new ContextIO error

Parameters:

  • message (String)

    The error message.

  • http_headers (Hash{String => String})

    The HTTP headers.



18
19
20
21
# File 'lib/context-io/error.rb', line 18

def initialize(message, http_headers)
  @http_headers = Hash[http_headers]
  super(message)
end

Instance Attribute Details

#http_headersHash{String => String} (readonly)

Returns The HTTP headers of the response.

Returns:

  • (Hash{String => String})

    The HTTP headers of the response.



9
10
11
# File 'lib/context-io/error.rb', line 9

def http_headers
  @http_headers
end