Skip to content

a2a: display JSON-RPC errors with full details#2186

Merged
birdayz merged 1 commit intomasterfrom
jb/a2a-error-display
Jan 28, 2026
Merged

a2a: display JSON-RPC errors with full details#2186
birdayz merged 1 commit intomasterfrom
jb/a2a-error-display

Conversation

@birdayz
Copy link
Contributor

@birdayz birdayz commented Jan 27, 2026

What

Display A2A JSON-RPC errors with full details (code, message, data) instead of a useless generic error message.

Why

The previous error handling showed "Sorry, I encountered an error. Please try again." - completely useless for debugging. Users had no idea what went wrong.

Implementation details

  • Add a2a-error ContentBlock type using SDK's JSONRPCError type
  • New A2AErrorBlock component renders error details in a destructive Alert
  • Error codes mapped to names based on a2a-go/a2a/errors.go (includes -32000 Server Error, -32008 Auth Failed, -32009 Forbidden)
  • parseA2AError() extracts code/message/data from error strings
  • Remove duplicate error handling in use-chat-actions.ts

References

a2a-js PR: a2aproject/a2a-js#315

20260127_18h27m45s_grim

@birdayz birdayz marked this pull request as draft January 27, 2026 17:30
The previous error handling was useless - it showed a generic
"Sorry, I encountered an error" message that told users nothing
about what actually went wrong.

Now when an A2A JSON-RPC error occurs, we display a proper error
block showing code, message, and data fields. Error codes are
mapped to human-readable names based on a2a-go/a2a/errors.go.

The duplicate error message creation in use-chat-actions.ts is
removed since use-message-streaming.ts now handles error display
properly via the onMessageUpdate callback.
@birdayz birdayz merged commit 83a8840 into master Jan 28, 2026
13 checks passed
@birdayz birdayz deleted the jb/a2a-error-display branch January 28, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants