File tree Expand file tree Collapse file tree
src/a2a/server/request_handlers
tests/server/request_handlers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646 PushNotificationNotSupportedError ,
4747 TaskNotCancelableError ,
4848 TaskNotFoundError ,
49- UnsupportedOperationError ,
5049)
5150from a2a .utils .helpers import maybe_await
5251from a2a .utils .task import (
@@ -383,7 +382,7 @@ async def on_get_task_push_notification_config( # noqa: D102
383382 if config .id == config_id :
384383 return config
385384
386- raise InternalError ( message = 'Push notification config not found' )
385+ raise TaskNotFoundError
387386
388387 @validate_request_params
389388 @validate (
@@ -418,7 +417,7 @@ async def on_list_task_push_notification_configs( # noqa: D102
418417 context : ServerCallContext ,
419418 ) -> ListTaskPushNotificationConfigsResponse :
420419 if not self ._push_config_store :
421- raise UnsupportedOperationError
420+ raise PushNotificationNotSupportedError
422421
423422 task_id = params .task_id
424423 task : Task | None = await self .task_store .get (task_id , context )
@@ -445,7 +444,7 @@ async def on_delete_task_push_notification_config( # noqa: D102
445444 context : ServerCallContext ,
446445 ) -> None :
447446 if not self ._push_config_store :
448- raise UnsupportedOperationError
447+ raise PushNotificationNotSupportedError
449448
450449 task_id = params .task_id
451450 config_id = params .id
Original file line number Diff line number Diff line change @@ -446,7 +446,7 @@ async def test_get_task_push_notification_config_info_not_found():
446446 task_id = 'non_existent_task' , id = 'task_push_notification_config'
447447 )
448448 context = create_server_call_context ()
449- with pytest .raises (InternalError ):
449+ with pytest .raises (TaskNotFoundError ):
450450 await request_handler .on_get_task_push_notification_config (
451451 params , context
452452 )
You can’t perform that action at this time.
0 commit comments