fix(grpc): align unsupported operation status - #1059
Conversation
5353b19 to
d87ca59
Compare
kabir
left a comment
There was a problem hiding this comment.
Hi @dangzitou - thank you for the PR!
One small issue:
The fallback switch in GrpcErrorMapper.java (line 77) still maps UNIMPLEMENTED to UnsupportedOperationError. Since the server now sends FAILED_PRECONDITION for this error, this fallback won't match when ErrorInfo details are absent. Consider adding a
FAILED_PRECONDITION case alongside the existing UNIMPLEMENTED one (since UNIMPLEMENTED is still used by other error types like PushNotificationNotSupportedError).
The primary ErrorInfo-based path (lines 62-70) handles this correctly via the reason field, so this only affects the fallback.
Signed-off-by: Dang Zitou <dengzitao888@163.com>
4b28625 to
2d1a7cb
Compare
|
Addressed the requested fallback mapping in 2d1a7cb: |
Description
Align
UnsupportedOperationErrorwith the A2A gRPC specification by mapping it toFAILED_PRECONDITIONinstead ofUNIMPLEMENTED. Update the existing server and client mapping assertions, plus the handler mapping documentation.CONTRIBUTINGGuide.Reproduction
On current
main, changing only the eight existingGrpcHandlerTestexpectations for paths that emitUnsupportedOperationErrorproduced 8 consistent failures out of 42 tests:Verification
Run with OpenJDK 17:
Results:
transport/grpc: 42 tests passedclient/transport/grpc: 9 tests passedA root
mvn clean installwas also attempted, but the unrelatedclient/transport/jsonrpctests could not bind/use their hard-coded local endpoint because127.0.0.1:4001was already occupied by another local application. The two changed gRPC modules were fully tested separately above.This fixes #1051