in aws-kendra-faq/src/main/java/software/amazon/kendra/faq/DeleteHandler.java [67:90]
private DeleteFaqResponse deleteFaq(
final DeleteFaqRequest deleteFaqRequest,
final ProxyClient<KendraClient> proxyClient) {
DeleteFaqResponse deleteFaqResponse;
try {
deleteFaqResponse = proxyClient.injectCredentialsAndInvokeV2(
deleteFaqRequest, proxyClient.client()::deleteFaq);
} catch (ResourceNotFoundException e) {
throw new CfnNotFoundException(ResourceModel.TYPE_NAME, deleteFaqRequest.id(), e);
} catch (ConflictException e) {
throw new CfnResourceConflictException(e);
} catch (final AwsServiceException e) {
/*
* While the handler contract states that the handler must always return a progress event,
* you may throw any instance of BaseHandlerException, as the wrapper map it to a progress event.
* Each BaseHandlerException maps to a specific error code, and you should map service exceptions as closely as possible
* to more specific error codes
*/
throw new CfnGeneralServiceException(DELETE_FAQ, e);
}
logger.log(String.format("%s successfully deleted.", ResourceModel.TYPE_NAME));
return deleteFaqResponse;
}