Class DecorateErrorFromResponseBodyUnmarshaller
- java.lang.Object
-
- software.amazon.awssdk.protocols.xml.internal.unmarshall.DecorateErrorFromResponseBodyUnmarshaller
-
- All Implemented Interfaces:
Function<AwsXmlUnmarshallingContext,AwsXmlUnmarshallingContext>
@SdkInternalApi public class DecorateErrorFromResponseBodyUnmarshaller extends Object implements Function<AwsXmlUnmarshallingContext,AwsXmlUnmarshallingContext>
A function that decorates aAwsXmlUnmarshallingContextthat already contains the parsed XML of the response body with parsed error XML if the HTTP response status indicates failure or a serialized error is found in the XML body of a 'successful' response. This is a non-standard error handling behavior that is used by some non-streaming S3 operations.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AwsXmlUnmarshallingContextapply(AwsXmlUnmarshallingContext context)static DecorateErrorFromResponseBodyUnmarshallerof(Function<XmlElement,Optional<XmlElement>> errorRootFunction)Constructs a function that can be used to decorate a parsed error from a response if one is found.
-
-
-
Method Detail
-
of
public static DecorateErrorFromResponseBodyUnmarshaller of(Function<XmlElement,Optional<XmlElement>> errorRootFunction)
Constructs a function that can be used to decorate a parsed error from a response if one is found.- Parameters:
errorRootFunction- A function that can be used to locate the root of the serialized error in the XML body if the HTTP status code of the response indicates an error. This function is not applied for HTTP responses that indicate success, instead the root of the document will always be checked for an element tagged 'Error'.- Returns:
- An unmarshalling function that will decorate the unmarshalling context with a parsed error if one is found in the response.
-
apply
public AwsXmlUnmarshallingContext apply(AwsXmlUnmarshallingContext context)
- Specified by:
applyin interfaceFunction<AwsXmlUnmarshallingContext,AwsXmlUnmarshallingContext>
-
-