Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Bug]: A2A exceptions lost their structured __repr__ after the client error refactor (#761)

Đang mở
#1,347 0 bình luận 0 reaction 2 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@rohityan đang làm issue này rồi.

Từ ngày 16/10/2026.

  • #1348 của @cchinchilla-dev — đang mở

Đá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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của a2aproject/a2a-python

Tất cả issue của a2aproject/a2a-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.