feat: expose HTTP status code and headers on SDK error classes#319
Open
corvid-agent wants to merge 3 commits intoa2aproject:mainfrom
Open
feat: expose HTTP status code and headers on SDK error classes#319corvid-agent wants to merge 3 commits intoa2aproject:mainfrom
corvid-agent wants to merge 3 commits intoa2aproject:mainfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
statusCodeandheadersproperties to all A2A SDK error classes (TaskNotFoundError,TaskNotCancelableError,PushNotificationNotSupportedError,UnsupportedOperationError,ContentTypeNotSupportedError,InvalidAgentResponseError,AuthenticatedExtendedCardNotConfiguredError) so that consumers can implement HTTP-aware error handling.RestTransport) to extract HTTP status code and response headers from theResponseobject and pass them through when constructing error instances viamapToError.A2AErrorHttpDetailsinterface from the client entry point for use by consumers.statusCodeandheadersare correctly populated on errors thrown by the REST transport.Closes #317
Test plan
statusCodeis set onTaskNotFoundError(404),TaskNotCancelableError(409),PushNotificationNotSupportedError(400),UnsupportedOperationError(405),ContentTypeNotSupportedError(415),InvalidAgentResponseError(502), andAuthenticatedExtendedCardNotConfiguredError(401)Retry-After,X-RateLimit-Remaining) are available on errors for rate-limiting / backoff strategies🤖 Generated with Claude Code