Exception: A2A::Internal::Errors::PushNotificationConfigNotFoundError

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

Overview

Raised when a specific push notification config cannot be found by ID. This is an implementation detail — the spec does not define this error.

Instance Attribute Summary

Attributes inherited from Error

#code, #http_status

Instance Method Summary collapse

Methods inherited from Error

#to_h

Constructor Details

#initialize(task_id, config_id, message: "Push notification config not found") ⇒ PushNotificationConfigNotFoundError

Returns a new instance of PushNotificationConfigNotFoundError.



241
242
243
244
245
# File 'lib/a2a/errors.rb', line 241

def initialize(task_id, config_id, message: "Push notification config not found")
  @task_id   = task_id
  @config_id = config_id
  super(message, code: -32001, http_status: 404)
end

Instance Method Details

#error_dataObject



247
248
249
250
251
252
253
254
# File 'lib/a2a/errors.rb', line 247

def error_data
  [{
    "@type"    => "type.googleapis.com/google.rpc.ErrorInfo",
    "reason"   => "TASK_NOT_FOUND",
    "domain"   => "a2a-protocol.org",
    "metadata" => { "taskId" => @task_id.to_s, "configId" => @config_id.to_s },
  }]
end