public class JsonErrorUnmarshaller extends AbstractErrorUnmarshaller<JsonErrorResponseHandler.JsonErrorResponse>
exceptionClass
Modifier | Constructor and Description |
---|---|
|
JsonErrorUnmarshaller()
Constructor.
|
protected |
JsonErrorUnmarshaller(java.lang.Class<? extends AmazonServiceException> exceptionClass) |
Modifier and Type | Method and Description |
---|---|
boolean |
match(JsonErrorResponseHandler.JsonErrorResponse error)
Any subclass that is specific to a error type should only return true
when the response matches, either by matching the error type parsed from
header or from the JSON content.
|
AmazonServiceException |
unmarshall(JsonErrorResponseHandler.JsonErrorResponse error)
Subclass should override the match(String, JSONObject) method to indicate
whether it represents the given error type, and unmarshall(JSONObject)
should never return null.
|
newException
public JsonErrorUnmarshaller()
protected JsonErrorUnmarshaller(java.lang.Class<? extends AmazonServiceException> exceptionClass)
public AmazonServiceException unmarshall(JsonErrorResponseHandler.JsonErrorResponse error) throws java.lang.Exception
error
- to unmarshall.java.lang.Exception
public boolean match(JsonErrorResponseHandler.JsonErrorResponse error) throws java.lang.Exception
error
- The JSON content of the response. Subclass should check for
the error type information from this JSONObject if
errorTypeFromHeader is null.java.lang.Exception