Exception: Keiyaku::HTTPError

Inherits:
Error
  • Object
show all
Defined in:
sig/keiyaku.rbs,
lib/keiyaku/runtime.rb

Direct Known Subclasses

ClientError, ServerError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, headers:, body:, parsed: nil) ⇒ HTTPError

Returns a new instance of HTTPError.

Parameters:

  • status: (Integer)
  • headers: (Hash[String, String])
  • body: (String, nil)
  • parsed: (Object) (defaults to: nil)


33
# File 'sig/keiyaku.rbs', line 33

def initialize: (status: Integer, headers: Hash[String, String], body: String?, ?parsed: untyped) -> void

Instance Attribute Details

#bodyString? (readonly)

Returns the value of attribute body.

Returns:

  • (String, nil)


27
28
29
# File 'sig/keiyaku.rbs', line 27

def body
  @body
end

#headersHash[String, String] (readonly)

Returns the value of attribute headers.

Returns:

  • (Hash[String, String])


26
27
28
# File 'sig/keiyaku.rbs', line 26

def headers
  @headers
end

#parsedObject (readonly)

The decoded body: a model if the operation documents a schema for this status, otherwise whatever JSON.parse returned.

Returns:

  • (Object)


31
32
33
# File 'sig/keiyaku.rbs', line 31

def parsed
  @parsed
end

#statusInteger (readonly)

Returns the value of attribute status.

Returns:

  • (Integer)


25
26
27
# File 'sig/keiyaku.rbs', line 25

def status
  @status
end