Class DecorateErrorFromResponseBodyUnmarshaller
java.lang.Object
software.amazon.awssdk.protocols.xml.internal.unmarshall.DecorateErrorFromResponseBodyUnmarshaller
- All Implemented Interfaces:
Function<AwsXmlUnmarshallingContext,
AwsXmlUnmarshallingContext>
public class DecorateErrorFromResponseBodyUnmarshaller
extends Object
implements Function<AwsXmlUnmarshallingContext,AwsXmlUnmarshallingContext>
A function that decorates a
AwsXmlUnmarshallingContext
that 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
Modifier and TypeMethodDescriptionapply
(AwsXmlUnmarshallingContext context) 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.
-
Method Details
-
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
- Specified by:
apply
in interfaceFunction<AwsXmlUnmarshallingContext,
AwsXmlUnmarshallingContext>
-