in aws-codegurureviewer-repositoryassociation/src/main/java/software/amazon/codegurureviewer/repositoryassociation/DeleteHandler.java [102:132]
private DisassociateRepositoryResponse deleteResource(
final DisassociateRepositoryRequest disassociateRepositoryRequest,
final ProxyClient<CodeGuruReviewerClient> proxyClient,
final ResourceModel model,
final CallbackContext callbackContext) {
DisassociateRepositoryResponse awsResponse = null;
try {
awsResponse = proxyClient.injectCredentialsAndInvokeV2(disassociateRepositoryRequest,
proxyClient.client()::disassociateRepository);
callbackContext.setDeleteWorkflow(true);
logger.log(String.format("DisassociateRepository response: %s", awsResponse.toString()));
} catch (final NotFoundException e) {
throw new CfnNotFoundException(ResourceModel.TYPE_NAME, model.getName(), e);
} catch (final InternalServerException e) {
throw new CfnServiceInternalErrorException(ResourceModel.TYPE_NAME, e);
} catch (final ValidationException e) {
throw new CfnInvalidRequestException(ResourceModel.TYPE_NAME, e);
} catch (final AccessDeniedException e) {
throw new CfnAccessDeniedException(ResourceModel.TYPE_NAME, e);
} catch (final ConflictException e) {
throw new CfnAlreadyExistsException(ResourceModel.TYPE_NAME, model.getName(), e);
} catch (final ThrottlingException e) {
throw new CfnThrottlingException(ResourceModel.TYPE_NAME, e);
} catch (final Exception e) {
throw new CfnInternalFailureException(e);
}
logger.log(String.format("%s successfully deleted.", ResourceModel.TYPE_NAME));
return awsResponse;
}