@Override public AmazonServiceException unmarshall(Node in) throws Exception { XPath xpath = xpath(); String errorCode = parseErrorCode(in, xpath); String message = asString("Response/Errors/Error/Message", in, xpath); String requestId = asString("Response/RequestID", in, xpath); String errorType = asString("Response/Errors/Error/Type", in, xpath); Constructor<? extends AmazonServiceException> constructor = exceptionClass.getConstructor(String.class); AmazonServiceException ase = constructor.newInstance(message); ase.setErrorCode(errorCode); ase.setRequestId(requestId); if (errorType == null) { ase.setErrorType(ErrorType.Unknown); } else if (errorType.equalsIgnoreCase("server")) { ase.setErrorType(ErrorType.Service); } else if (errorType.equalsIgnoreCase("client")) { ase.setErrorType(ErrorType.Client); } return ase; }
@Override public AmazonServiceException unmarshall(Node in) throws Exception { String errorCode = parseErrorCode(in); String message = XpathUtils.asString("Response/Errors/Error/Message", in); String requestId = XpathUtils.asString("Response/RequestID", in); String errorType = XpathUtils.asString("Response/Errors/Error/Type", in); Constructor<? extends AmazonServiceException> constructor = exceptionClass .getConstructor(String.class); AmazonServiceException ase = constructor.newInstance(message); ase.setErrorCode(errorCode); ase.setRequestId(requestId); if (errorType == null) { ase.setErrorType(ErrorType.Unknown); } else if ("server".equalsIgnoreCase(errorType)) { ase.setErrorType(ErrorType.Service); } else if ("client".equalsIgnoreCase(errorType)) { ase.setErrorType(ErrorType.Client); } return ase; }
@Override public AmazonServiceException unmarshall(Node in) throws Exception { XPath xpath = xpath(); String errorCode = parseErrorCode(in, xpath); String message = asString("Response/Errors/Error/Message", in, xpath); String requestId = asString("Response/RequestID", in, xpath); String errorType = asString("Response/Errors/Error/Type", in, xpath); Constructor<? extends AmazonServiceException> constructor = exceptionClass.getConstructor(String.class); AmazonServiceException ase = constructor.newInstance(message); ase.setErrorCode(errorCode); ase.setRequestId(requestId); if (errorType == null) { ase.setErrorType(ErrorType.Unknown); } else if (errorType.equalsIgnoreCase("server")) { ase.setErrorType(ErrorType.Service); } else if (errorType.equalsIgnoreCase("client")) { ase.setErrorType(ErrorType.Client); } return ase; }
@Override public AmazonServiceException unmarshall(Node in) throws Exception { String errorCode = parseErrorCode(in); String message = XpathUtils.asString("Response/Errors/Error/Message", in); String requestId = XpathUtils.asString("Response/RequestID", in); String errorType = XpathUtils.asString("Response/Errors/Error/Type", in); Constructor<? extends AmazonServiceException> constructor = exceptionClass .getConstructor(String.class); AmazonServiceException ase = constructor.newInstance(message); ase.setErrorCode(errorCode); ase.setRequestId(requestId); if (errorType == null) { ase.setErrorType(ErrorType.Unknown); } else if ("server".equalsIgnoreCase(errorType)) { ase.setErrorType(ErrorType.Service); } else if ("client".equalsIgnoreCase(errorType)) { ase.setErrorType(ErrorType.Client); } return ase; }
@Override public AmazonServiceException unmarshall(Node in) throws Exception { String errorCode = parseErrorCode(in); String message = XpathUtils.asString("Response/Errors/Error/Message", in); String requestId = XpathUtils.asString("Response/RequestID", in); String errorType = XpathUtils.asString("Response/Errors/Error/Type", in); Constructor<? extends AmazonServiceException> constructor = exceptionClass .getConstructor(String.class); AmazonServiceException ase = constructor.newInstance(message); ase.setErrorCode(errorCode); ase.setRequestId(requestId); if (errorType == null) { ase.setErrorType(ErrorType.Unknown); } else if ("server".equalsIgnoreCase(errorType)) { ase.setErrorType(ErrorType.Service); } else if ("client".equalsIgnoreCase(errorType)) { ase.setErrorType(ErrorType.Client); } return ase; }
@Override public AmazonServiceException unmarshall(Node in) throws Exception { XPath xpath = xpath(); String errorCode = parseErrorCode(in, xpath); String message = asString("Response/Errors/Error/Message", in, xpath); String requestId = asString("Response/RequestID", in, xpath); String errorType = asString("Response/Errors/Error/Type", in, xpath); Constructor<? extends AmazonServiceException> constructor = exceptionClass.getConstructor(String.class); AmazonServiceException ase = constructor.newInstance(message); ase.setErrorCode(errorCode); ase.setRequestId(requestId); if (errorType == null) { ase.setErrorType(ErrorType.Unknown); } else if (errorType.equalsIgnoreCase("server")) { ase.setErrorType(ErrorType.Service); } else if (errorType.equalsIgnoreCase("client")) { ase.setErrorType(ErrorType.Client); } return ase; }