in aws-devopsguru-notificationchannel/src/main/java/software/amazon/devopsguru/notificationchannel/CreateHandler.java [53:81]
private AddNotificationChannelResponse createResource(
final AddNotificationChannelRequest addNotificationChannelRequest,
final ProxyClient<DevOpsGuruClient> proxyClient,
final ResourceModel model,
final CallbackContext callbackContext){
AddNotificationChannelResponse addNotificationChannelResponse = null;
try {
addNotificationChannelResponse = proxyClient.injectCredentialsAndInvokeV2(addNotificationChannelRequest, proxyClient.client()::addNotificationChannel);
logger.log(String.format("PutNotificationChannel response: %s, ", addNotificationChannelResponse.toString()));
model.setId(addNotificationChannelResponse.id());
} catch (final AccessDeniedException e) {
throw new CfnAccessDeniedException(ResourceModel.TYPE_NAME, e);
} catch (final InternalServerException e) {
throw new CfnServiceInternalErrorException(ResourceModel.TYPE_NAME, e);
} catch (final ResourceNotFoundException e) {
throw new CfnNotFoundException(ResourceModel.TYPE_NAME, model.getConfig().toString(), e);
} catch (final ValidationException e) {
throw new CfnInvalidRequestException(e);
} catch (final ThrottlingException e) {
throw new CfnThrottlingException(ResourceModel.TYPE_NAME, e);
} catch (final ServiceQuotaExceededException e) {
throw new CfnServiceLimitExceededException(ResourceModel.TYPE_NAME, "ServiceQuotaExceeded", e);
} catch (final Exception e) {
throw new CfnInternalFailureException(e);
}
return addNotificationChannelResponse;
}