Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapped ThrottlingException to HandlerErrorCode.Throttling #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import software.amazon.awssdk.services.redshiftserverless.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.redshiftserverless.model.Namespace;
import software.amazon.awssdk.services.redshiftserverless.model.ResourceNotFoundException;
import software.amazon.awssdk.services.redshiftserverless.model.ThrottlingException;
import software.amazon.awssdk.services.redshiftserverless.model.TooManyTagsException;
import software.amazon.awssdk.services.redshiftserverless.model.ValidationException;
import software.amazon.awssdk.services.redshift.RedshiftClient;
Expand Down Expand Up @@ -148,6 +149,8 @@ protected ProgressEvent<ResourceModel, CallbackContext> errorHandler(final Excep
return ProgressEvent.defaultFailureHandler(exception, HandlerErrorCode.ServiceInternalError);
} else if (exception instanceof ResourceNotFoundException) {
return ProgressEvent.defaultFailureHandler(exception, HandlerErrorCode.NotFound);
} else if (exception instanceof ThrottlingException) {
return ProgressEvent.defaultFailureHandler(exception, HandlerErrorCode.Throttling);
} else if (exception instanceof TooManyTagsException || exception instanceof ServiceQuotaExceededException) {
return ProgressEvent.defaultFailureHandler(exception, HandlerErrorCode.ServiceLimitExceeded);
} else if (exception instanceof ConflictException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import software.amazon.awssdk.services.redshiftserverless.model.GetWorkgroupResponse;
import software.amazon.awssdk.services.redshiftserverless.model.Namespace;
import software.amazon.awssdk.services.redshiftserverless.model.NamespaceStatus;
import software.amazon.awssdk.services.redshiftserverless.model.ThrottlingException;
import software.amazon.awssdk.services.redshiftserverless.model.WorkgroupStatus;
import software.amazon.awssdk.services.redshiftserverless.model.RedshiftServerlessResponse;
import software.amazon.awssdk.services.redshiftserverless.model.ResourceNotFoundException;
Expand Down Expand Up @@ -231,6 +232,9 @@ protected ProgressEvent<ResourceModel, CallbackContext> defaultWorkgroupErrorHan
} else if (exception instanceof ValidationException) {
return ProgressEvent.defaultFailureHandler(exception, HandlerErrorCode.InvalidRequest);

} else if (exception instanceof ThrottlingException) {
return ProgressEvent.defaultFailureHandler(exception, HandlerErrorCode.Throttling);

} else {
return ProgressEvent.defaultFailureHandler(exception, HandlerErrorCode.GeneralServiceException);
}
Expand Down