in source/src/main/java/com/amazonaws/comprehend/esproxy/lambda/processor/callable/SingularOperationCallable.java [52:73]
public SingularResponse call() {
try {
return comprehendOperation.getComprehendOperation()
.sendSingularRequest(fieldNameAndOperation, content, languageCode, comprehendClient);
} catch (AmazonServiceException e) {
ServiceExceptionMessage serviceException = ServiceExceptionMessage.builder()
.statusCode(e.getStatusCode())
.errorCode(e.getErrorCode())
.requestId(e.getRequestId())
.errorMessage(e.getErrorMessage())
.build();
return new SingularResponse(String.format("%s_Error", fieldNameAndOperation),
new JSONObject(serviceException), null);
} catch (AmazonClientException e) {
ClientExceptionMessage clientException = ClientExceptionMessage.builder()
.errorCode(Constants.CLIENT_EXCEPTION_ERROR_CODE)
.errorMessage(e.getMessage())
.build();
return new SingularResponse(String.format("%s_Error", fieldNameAndOperation),
new JSONObject(clientException), null);
}
}