Exception: Braintrust::HTTP::ResponseError

Inherits:
Error
  • Object
show all
Defined in:
lib/braintrust/base_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message:, response:, body:) ⇒ ResponseError

Returns a new instance of ResponseError.



333
334
335
336
337
338
# File 'lib/braintrust/base_client.rb', line 333

def initialize(message:, response:, body:)
  super(message)
  @response = response
  @body = body
  @code = response.code.to_i
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



331
332
333
# File 'lib/braintrust/base_client.rb', line 331

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



331
332
333
# File 'lib/braintrust/base_client.rb', line 331

def code
  @code
end

#responseObject (readonly)

Returns the value of attribute response.



331
332
333
# File 'lib/braintrust/base_client.rb', line 331

def response
  @response
end