Class ClientException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.mule.runtime.api.exception.MuleRuntimeException
org.mule.runtime.extension.api.exception.ModuleException
com.mulesoft.connectors.a2a.internal.error.exception.ClientException
- All Implemented Interfaces:
Serializable,org.mule.runtime.api.exception.ErrorMessageAwareException
public class ClientException
extends org.mule.runtime.extension.api.exception.ModuleException
implements org.mule.runtime.api.exception.ErrorMessageAwareException
Exception that carries the complete response details (body and attributes) when A2A client operations fail. Implements
ErrorMessageAwareException to provide structured access to error response via error.errorMessage.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionClientException(String message, A2AErrorTypes errorType) Constructor for client-side errors without server responseClientException(String message, A2AErrorTypes errorType, String responseBody, ResponseAttributes responseAttributes) -
Method Summary
Modifier and TypeMethodDescriptionorg.mule.runtime.api.message.MessageImplementation of ErrorMessageAwareException - provides structured access to error response.Provides access to the response attributes (status code, headers, etc.)Provides access to the response body as a String.Methods inherited from class org.mule.runtime.extension.api.exception.ModuleException
getType, toStringMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
ClientException
public ClientException(String message, A2AErrorTypes errorType, String responseBody, ResponseAttributes responseAttributes) -
ClientException
Constructor for client-side errors without server response
-
-
Method Details
-
getResponseBody
Provides access to the response body as a String.- Returns:
- String containing the response body
-
getResponseAttributes
Provides access to the response attributes (status code, headers, etc.)- Returns:
- ResponseAttributes object with HTTP response details
-
getErrorMessage
public org.mule.runtime.api.message.Message getErrorMessage()Implementation of ErrorMessageAwareException - provides structured access to error response. Users can access: error.errorMessage.payload (response body) and error.errorMessage.attributes (response attributes)- Specified by:
getErrorMessagein interfaceorg.mule.runtime.api.exception.ErrorMessageAwareException- Returns:
- Message containing response body as payload and attributes
-