package com.amazonaws.transform; import com.amazonaws.AmazonClientException; import com.amazonaws.AmazonServiceException; import com.amazonaws.http.JsonErrorResponseHandler; /* loaded from: classes.dex */ public class JsonErrorUnmarshaller extends AbstractErrorUnmarshaller { public boolean match(JsonErrorResponseHandler.JsonErrorResponse jsonErrorResponse) { return true; } public JsonErrorUnmarshaller() { } public JsonErrorUnmarshaller(Class cls) { super(cls); } @Override // com.amazonaws.transform.Unmarshaller public AmazonServiceException unmarshall(JsonErrorResponseHandler.JsonErrorResponse jsonErrorResponse) { String message = jsonErrorResponse.getMessage(); String errorCode = jsonErrorResponse.getErrorCode(); if ((message == null || message.isEmpty()) && (errorCode == null || errorCode.isEmpty())) { throw new AmazonClientException("Neither error message nor error code is found in the error response payload."); } AmazonServiceException newException = newException(message); newException.setErrorCode(errorCode); return newException; } }