Skip to content

Commit 8645935

Browse files
committed
Renaming
1 parent b4c7f8c commit 8645935

10 files changed

Lines changed: 21 additions & 21 deletions

File tree

src/a2a/compat/v0_3/jsonrpc_adapter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
from a2a.server.jsonrpc_models import (
3939
JSONRPCError as CoreJSONRPCError,
4040
)
41-
from a2a.utils.errors import AuthenticatedExtendedCardNotConfiguredError
41+
from a2a.utils.errors import ExtendedAgentCardNotConfiguredError
4242
from a2a.utils.helpers import maybe_await
4343

4444

@@ -248,7 +248,7 @@ async def get_authenticated_extended_card(
248248
) -> types_v03.AgentCard:
249249
"""Handles the 'agent/authenticatedExtendedCard' JSON-RPC method."""
250250
if not self.agent_card.capabilities.extended_agent_card:
251-
raise AuthenticatedExtendedCardNotConfiguredError(
251+
raise ExtendedAgentCardNotConfiguredError(
252252
message='Authenticated card not supported'
253253
)
254254

src/a2a/compat/v0_3/rest_adapter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
rest_stream_error_handler,
4444
)
4545
from a2a.utils.errors import (
46-
AuthenticatedExtendedCardNotConfiguredError,
46+
ExtendedAgentCardNotConfiguredError,
4747
InvalidRequestError,
4848
)
4949
from a2a.utils.helpers import maybe_await
@@ -126,7 +126,7 @@ async def handle_authenticated_agent_card(
126126
) -> dict[str, Any]:
127127
"""Hook for per credential agent card response."""
128128
if not self.agent_card.capabilities.extended_agent_card:
129-
raise AuthenticatedExtendedCardNotConfiguredError(
129+
raise ExtendedAgentCardNotConfiguredError(
130130
message='Authenticated card not supported'
131131
)
132132
card_to_serve = self.extended_agent_card

src/a2a/server/apps/rest/rest_adapter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
rest_stream_error_handler,
4646
)
4747
from a2a.utils.errors import (
48-
AuthenticatedExtendedCardNotConfiguredError,
48+
ExtendedAgentCardNotConfiguredError,
4949
InvalidRequestError,
5050
)
5151

@@ -192,7 +192,7 @@ async def _handle_authenticated_agent_card(
192192
A JSONResponse containing the authenticated card.
193193
"""
194194
if not self.agent_card.capabilities.extended_agent_card:
195-
raise AuthenticatedExtendedCardNotConfiguredError(
195+
raise ExtendedAgentCardNotConfiguredError(
196196
message='Authenticated card not supported'
197197
)
198198
card_to_serve = self.extended_agent_card

src/a2a/server/request_handlers/grpc_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def build(self, context: grpc.aio.ServicerContext) -> ServerCallContext:
9595
types.UnsupportedOperationError: grpc.StatusCode.UNIMPLEMENTED,
9696
types.ContentTypeNotSupportedError: grpc.StatusCode.INVALID_ARGUMENT,
9797
types.InvalidAgentResponseError: grpc.StatusCode.INTERNAL,
98-
types.AuthenticatedExtendedCardNotConfiguredError: grpc.StatusCode.FAILED_PRECONDITION,
98+
types.ExtendedAgentCardNotConfiguredError: grpc.StatusCode.FAILED_PRECONDITION,
9999
types.ExtensionSupportRequiredError: grpc.StatusCode.FAILED_PRECONDITION,
100100
types.VersionNotSupportedError: grpc.StatusCode.UNIMPLEMENTED,
101101
}

src/a2a/server/request_handlers/jsonrpc_handler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
from a2a.utils.errors import (
3636
JSON_RPC_ERROR_CODE_MAP,
3737
A2AError,
38-
AuthenticatedExtendedCardNotConfiguredError,
3938
ContentTypeNotSupportedError,
39+
ExtendedAgentCardNotConfiguredError,
4040
ExtensionSupportRequiredError,
4141
InternalError,
4242
InvalidAgentResponseError,
@@ -63,7 +63,7 @@
6363
UnsupportedOperationError: JSONRPCError,
6464
ContentTypeNotSupportedError: JSONRPCError,
6565
InvalidAgentResponseError: JSONRPCError,
66-
AuthenticatedExtendedCardNotConfiguredError: JSONRPCError,
66+
ExtendedAgentCardNotConfiguredError: JSONRPCError,
6767
InternalError: JSONRPCInternalError,
6868
InvalidParamsError: JSONRPCError,
6969
InvalidRequestError: JSONRPCError,
@@ -450,7 +450,7 @@ async def get_authenticated_extended_card(
450450
"""
451451
request_id = self._get_request_id(context)
452452
if not self.agent_card.capabilities.extended_agent_card:
453-
raise AuthenticatedExtendedCardNotConfiguredError(
453+
raise ExtendedAgentCardNotConfiguredError(
454454
message='Authenticated card not supported'
455455
)
456456

src/a2a/server/request_handlers/response_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
from a2a.utils.errors import (
3030
JSON_RPC_ERROR_CODE_MAP,
3131
A2AError,
32-
AuthenticatedExtendedCardNotConfiguredError,
3332
ContentTypeNotSupportedError,
33+
ExtendedAgentCardNotConfiguredError,
3434
ExtensionSupportRequiredError,
3535
InternalError,
3636
InvalidAgentResponseError,
@@ -52,7 +52,7 @@
5252
UnsupportedOperationError: JSONRPCError,
5353
ContentTypeNotSupportedError: JSONRPCError,
5454
InvalidAgentResponseError: JSONRPCError,
55-
AuthenticatedExtendedCardNotConfiguredError: JSONRPCError,
55+
ExtendedAgentCardNotConfiguredError: JSONRPCError,
5656
InvalidParamsError: JSONRPCError,
5757
InvalidRequestError: JSONRPCError,
5858
MethodNotFoundError: JSONRPCError,

src/a2a/types/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252

5353
# Import SDK-specific error types from utils.errors
5454
from a2a.utils.errors import (
55-
AuthenticatedExtendedCardNotConfiguredError,
5655
ContentTypeNotSupportedError,
56+
ExtendedAgentCardNotConfiguredError,
5757
ExtensionSupportRequiredError,
5858
InternalError,
5959
InvalidAgentResponseError,

src/a2a/utils/error_handlers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
)
2727
from a2a.utils.errors import (
2828
A2AError,
29-
AuthenticatedExtendedCardNotConfiguredError,
3029
ContentTypeNotSupportedError,
30+
ExtendedAgentCardNotConfiguredError,
3131
ExtensionSupportRequiredError,
3232
InternalError,
3333
InvalidAgentResponseError,
@@ -58,7 +58,7 @@
5858
| type[UnsupportedOperationError]
5959
| type[ContentTypeNotSupportedError]
6060
| type[InvalidAgentResponseError]
61-
| type[AuthenticatedExtendedCardNotConfiguredError]
61+
| type[ExtendedAgentCardNotConfiguredError]
6262
)
6363

6464
A2AErrorToHttpStatus: dict[_A2AErrorType, int] = {
@@ -75,7 +75,7 @@
7575
UnsupportedOperationError: 501,
7676
ContentTypeNotSupportedError: 415,
7777
InvalidAgentResponseError: 502,
78-
AuthenticatedExtendedCardNotConfiguredError: 404,
78+
ExtendedAgentCardNotConfiguredError: 400,
7979
ExtensionSupportRequiredError: 400,
8080
VersionNotSupportedError: 400,
8181
}

src/a2a/utils/errors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class InvalidAgentResponseError(A2AError):
5858
message = 'Invalid agent response'
5959

6060

61-
class AuthenticatedExtendedCardNotConfiguredError(A2AError):
61+
class ExtendedAgentCardNotConfiguredError(A2AError):
6262
"""Exception raised when the authenticated extended card is not configured."""
6363

6464
message = 'Authenticated Extended Card is not configured'
@@ -122,7 +122,7 @@ class VersionNotSupportedError(A2AError):
122122
UnsupportedOperationError: -32004,
123123
ContentTypeNotSupportedError: -32005,
124124
InvalidAgentResponseError: -32006,
125-
AuthenticatedExtendedCardNotConfiguredError: -32007,
125+
ExtendedAgentCardNotConfiguredError: -32007,
126126
ExtensionSupportRequiredError: -32008,
127127
VersionNotSupportedError: -32009,
128128
InvalidParamsError: -32602,
@@ -139,7 +139,7 @@ class VersionNotSupportedError(A2AError):
139139
UnsupportedOperationError: 'UNSUPPORTED_OPERATION',
140140
ContentTypeNotSupportedError: 'CONTENT_TYPE_NOT_SUPPORTED',
141141
InvalidAgentResponseError: 'INVALID_AGENT_RESPONSE',
142-
AuthenticatedExtendedCardNotConfiguredError: 'EXTENDED_AGENT_CARD_NOT_CONFIGURED',
142+
ExtendedAgentCardNotConfiguredError: 'EXTENDED_AGENT_CARD_NOT_CONFIGURED',
143143
ExtensionSupportRequiredError: 'EXTENSION_SUPPORT_REQUIRED',
144144
VersionNotSupportedError: 'VERSION_NOT_SUPPORTED',
145145
}

tests/integration/test_client_server_integration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
TransportProtocol,
5555
)
5656
from a2a.utils.errors import (
57-
AuthenticatedExtendedCardNotConfiguredError,
57+
ExtendedAgentCardNotConfiguredError,
5858
ContentTypeNotSupportedError,
5959
ExtensionSupportRequiredError,
6060
InternalError,
@@ -815,7 +815,7 @@ async def test_client_get_signed_base_and_extended_cards(
815815
UnsupportedOperationError,
816816
ContentTypeNotSupportedError,
817817
InvalidAgentResponseError,
818-
AuthenticatedExtendedCardNotConfiguredError,
818+
ExtendedAgentCardNotConfiguredError,
819819
ExtensionSupportRequiredError,
820820
VersionNotSupportedError,
821821
],

0 commit comments

Comments
 (0)