in aws-codegurureviewer-repositoryassociation/src/main/java/software/amazon/codegurureviewer/repositoryassociation/DeleteHandler.java [71:92]
private ProgressEvent<ResourceModel, CallbackContext> checkForPreDeleteResourceExistence(
final ResourceHandlerRequest<ResourceModel> request,
final ProgressEvent<ResourceModel, CallbackContext> progressEvent,
final ProxyClient<CodeGuruReviewerClient> proxyClient) {
final ResourceModel model = progressEvent.getResourceModel();
final CallbackContext callbackContext = progressEvent.getCallbackContext();
try {
proxyClient.injectCredentialsAndInvokeV2(Translator.translateToDescribeRepositoryAssociationRequest(model), proxyClient.client()::describeRepositoryAssociation).repositoryAssociation().state();
return ProgressEvent.progress(model, callbackContext);
} catch (NotFoundException e) { // ResourceNotFoundException
if (callbackContext.isDeleteWorkflow()) {
logger.log(String.format("In a delete workflow. Allow NotFoundException to propagate."));
return ProgressEvent.progress(model, callbackContext);
}
logger.log(String.format("%s does not exist. RequestId: %s. Message: %s",
model.getPrimaryIdentifier(),
request.getClientRequestToken(),
e.getMessage()));
throw new CfnNotFoundException(e);
}
}