[Bug]: A2A exceptions lost their structured __repr__ after the client error refactor (#761)
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
What happened?
#683 (for #679) added structured __repr__ methods to the client exception classes. The client error refactor in #761 replaced those classes with the new A2AError-based hierarchy (src/a2a/utils/errors.py, src/a2a/client/errors.py), and the __repr__ methods were not carried over.
Exceptions now fall back to the default Exception.__repr__, which only wraps str() output and loses structured attributes. Since server and client errors share A2AError, this affects both sides:
>>> repr(AgentCardResolutionError('Failed to fetch agent card', status_code=404))
"AgentCardResolutionError('Failed to fetch agent card')" # Loses status_code
>>> repr(InvalidParamsError('Invalid field', data={'field': 'id'}))
"InvalidParamsError('Invalid field')" # Loses data
Suggested fix: add __repr__ to A2AError, so every domain and client error inherits it, and override it in AgentCardResolutionError, following the same pattern as #683:
# A2AError
def __repr__(self) -> str:
return (
f'{self.__class__.__name__}('
f'message={self.message!r}, '
f'data={self.data!r})'
)
# AgentCardResolutionError
def __repr__(self) -> str:
return (
f'{self.__class__.__name__}('
f'status_code={self.status_code!r}, '
f'message={self.message!r})'
)
This does not alter __str__ output, traceback formatting, exception hierarchy or catching behavior.
If dropping __repr__ in #761 was intentional, I may be missing some context. In that case, feel free to close this.
I have a fix ready and I'm opening a PR alongside this issue.
Code of Conduct
- I agree to follow this project's Code of Conduct
- Ngôn ngữ chính
- Python
- Star
- 2.2k
- Fork
- 511
- Merge trung bình
- 3 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 47
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của a2aproject/a2a-python
-
[Bug]: REST task/request id sanitizationCó thể đã có người làm @Linux2010 đã nhận 112 ngày trước. Đang mởmaintainers-only
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
a2aproject/a2a-python#805 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: Executor failure right after its Task is enqueued leaves the task SUBMITTED on DatabaseTaskStoreCó thể đã có người làm @rohityan đã nhận hôm nay. Đang mở
a2aproject/a2a-python#1351 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: Closing one client from a ClientFactory closes the shared httpx client for every other clientCó thể đã có người làm @rohityan đã nhận 1 ngày trước. Đang mở
a2aproject/a2a-python#1349 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: `A2A-Version` sent as a request parameter is ignored (spec §3.6.1), so a v1.0 request is treated as 0.3Có thể đã có người làm @rohityan đã nhận 2 ngày trước. Đang mở
a2aproject/a2a-python#1344 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: Client transports reject responses with unrecognized fields (spec 5.7)Có thể đã có người làm @rohityan đã nhận 3 ngày trước. Đang mở
a2aproject/a2a-python#1341 · 1 bình luận · 2 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của a2aproject/a2a-python
Issue tương tự
-
bug Size: XS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
oposs/repo-infra#93 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
Graphify-Labs/graphify#4546 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
521xueweihan/HelloGitHub#4025 ·