Exception: A2A::RestError

Inherits:
Error
  • Object
show all
Defined in:
lib/a2a/errors/rest_error.rb

Overview

Raised by the REST response middleware when the server returns an HTTP 4xx/5xx with an application/problem+json body. Preserves the HTTP status, title/message, and optional detail array.

Instance Attribute Summary

Attributes inherited from Error

#code, #http_status

Instance Method Summary collapse

Methods inherited from Error

#to_h

Constructor Details

#initialize(message, http_status:, data: nil) ⇒ RestError

Returns a new instance of RestError.



12
13
14
15
# File 'lib/a2a/errors/rest_error.rb', line 12

def initialize(message, http_status:, data: nil)
  @wire_data = data
  super(message, code: http_status, http_status: http_status)
end

Instance Method Details

#error_dataObject



17
18
19
# File 'lib/a2a/errors/rest_error.rb', line 17

def error_data
  @wire_data
end