Class ErrorUtils
java.lang.Object
com.mulesoft.connectors.a2a.internal.error.ErrorUtils
Utility class for handling error types in the A2A connector.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<A2AErrorTypes>getA2AErrorType(Throwable throwable) Retrieves theA2AErrorTypesfrom a givenThrowable, if present.
-
Method Details
-
getA2AErrorType
Retrieves theA2AErrorTypesfrom a givenThrowable, if present.This method traverses the exception cause chain to find a
ModuleExceptionwith an error type that is an instance ofA2AErrorTypes. If found, it returns the error type wrapped in anOptional. If no matching error type is found, an emptyOptionalis returned.- Parameters:
throwable- theThrowableto analyze for anA2AErrorTypes- Returns:
- an
Optionalcontaining theA2AErrorTypesif found, or an emptyOptionalif no matching error type is present
-