Class ErrorConverter_v0_3

java.lang.Object
org.a2aproject.sdk.compat03.conversion.ErrorConverter_v0_3

public final class ErrorConverter_v0_3 extends Object
Utility for converting v1.0 A2AError instances to v0.3 JSONRPCError instances.

This converter preserves specific error types to ensure proper status code mapping in transport handlers (REST HTTP status codes, gRPC status codes, etc.).

  • Method Details

    • convertA2AError

      public static JSONRPCError_v0_3 convertA2AError(A2AError v10Error)
      Converts a v1.0 A2AError to a v0.3 JSONRPCError.

      Since A2AError in v0.3 is an interface and JSONRPCError is the concrete implementation, we need to convert the v1.0 A2AError to the v0.3 JSONRPCError type. This method preserves specific error types by using instanceof checks to map v1.0 errors to their v0.3 equivalents.

      Parameters:
      v10Error - the v1.0 A2AError to convert
      Returns:
      the equivalent v0.3 JSONRPCError, preserving the specific error type