File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -2132,9 +2132,11 @@ func (dwr *DynamoDB) createTable(tableName string) error {
2132
2132
},
2133
2133
BillingMode : types .BillingModePayPerRequest ,
2134
2134
})
2135
-
2136
- if err != nil && ! strings .Contains (err .Error (), "Table already exists" ) {
2137
- return err
2135
+ if err != nil {
2136
+ inUseException := new (types.ResourceInUseException )
2137
+ if ! errors .As (err , & inUseException ) {
2138
+ return err
2139
+ }
2138
2140
}
2139
2141
2140
2142
return dwr .waitTableToBeCreated (tableName )
@@ -2190,7 +2192,8 @@ func (dwr *DynamoDB) createVersionTable() error {
2190
2192
BillingMode : types .BillingModePayPerRequest ,
2191
2193
})
2192
2194
if err != nil {
2193
- if strings .Contains (err .Error (), "Table already exists" ) {
2195
+ inUseException := new (types.ResourceInUseException )
2196
+ if errors .As (err , & inUseException ) {
2194
2197
return nil
2195
2198
}
2196
2199
You can’t perform that action at this time.
0 commit comments