in aws-sns-subscription/src/main/java/software/amazon/sns/subscription/BaseHandlerStd.java [81:119]
protected abstract ProgressEvent<ResourceModel, CallbackContext> handleRequest(
final AmazonWebServicesClientProxy proxy,
final ResourceHandlerRequest<ResourceModel> request,
final CallbackContext callbackContext,
final ProxyClient<SnsClient> proxyClient,
final Logger logger);
protected GetSubscriptionAttributesResponse readSubscriptionAttributes(GetSubscriptionAttributesRequest getSubscriptionAttributesRequest,
final ProxyClient<SnsClient> proxyClient) {
final GetSubscriptionAttributesResponse getSubscriptionAttributesResponse;
try {
if (getSubscriptionAttributesRequest.subscriptionArn() == null) {
throw new CfnNotFoundException(new Exception("Subscription is null"));
}
getSubscriptionAttributesResponse = proxyClient.injectCredentialsAndInvokeV2(getSubscriptionAttributesRequest, proxyClient.client()::getSubscriptionAttributes);
if (!getSubscriptionAttributesResponse.hasAttributes()) {
throw new CfnNotFoundException(new Exception(String.format("Subscription %s does not exist.", getSubscriptionAttributesRequest.subscriptionArn())));
}
} catch (final SubscriptionLimitExceededException e) {
throw new CfnServiceLimitExceededException(e);
} catch (final FilterPolicyLimitExceededException e) {
throw new CfnServiceLimitExceededException(e);
} catch (final InvalidParameterException e) {
throw new CfnInvalidRequestException(e);
} catch (final InternalErrorException e) {
throw new CfnInternalFailureException(e);
} catch (final NotFoundException e) {
throw new CfnNotFoundException(e);
} catch (final AuthorizationErrorException e) {
throw new CfnAccessDeniedException(e);
} catch (final InvalidSecurityException e) {
throw new CfnInvalidCredentialsException(e);
}
return getSubscriptionAttributesResponse;
}