in aws-kendra-datasource/src/main/java/software/amazon/kendra/datasource/UpdateHandler.java [97:121]
private UpdateDataSourceResponse updateDataSource(
final UpdateDataSourceRequest updateDataSourceRequest,
final ProxyClient<KendraClient> proxyClient) {
UpdateDataSourceResponse updateDataSourceResponse;
try {
updateDataSourceResponse = proxyClient.injectCredentialsAndInvokeV2(updateDataSourceRequest, proxyClient.client()::updateDataSource);
} catch (ValidationException e) {
throw new CfnInvalidRequestException(e.getMessage(), e);
} catch (ResourceNotFoundException e) {
throw new CfnNotFoundException(ResourceModel.TYPE_NAME, updateDataSourceRequest.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(UPDATE_DATASOURCE, e);
}
logger.log(String.format("%s has successfully been updated.", ResourceModel.TYPE_NAME));
return updateDataSourceResponse;
}