Skip to content

Commit 267e42c

Browse files
fix: bad error checks in custom resources (#26392)
Fixes bad error checking in custom resoruce for cross-region-ssm-writer-handler and redshift cluster-reboot. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 6c75581 commit 267e42c

File tree

13 files changed

+876330
-31491
lines changed

13 files changed

+876330
-31491
lines changed

packages/@aws-cdk/aws-redshift-alpha/lib/cluster-parameter-change-reboot-handler/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// eslint-disable-next-line import/no-extraneous-dependencies
2-
import { Redshift } from '@aws-sdk/client-redshift';
2+
import { InvalidClusterStateFault, Redshift } from '@aws-sdk/client-redshift';
33

44
const redshift = new Redshift({});
55

@@ -21,7 +21,7 @@ async function rebootClusterIfRequired(clusterId: string, parameterGroupName: st
2121
try {
2222
await redshift.rebootCluster({ ClusterIdentifier: clusterId });
2323
} catch (err: any) {
24-
if (err.code === 'InvalidClusterState') {
24+
if (err instanceof InvalidClusterStateFault) {
2525
return await executeActionForStatus(status, 30000);
2626
} else {
2727
throw err;

0 commit comments

Comments
 (0)