File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -394,18 +394,16 @@ class ServerlessDynamodbLocal {
394394 } ) ;
395395 }
396396
397- await dynamodb . raw . send ( new CreateTableCommand ( migration ) ) . catch ( err => {
398- if ( err ) {
399- if ( err . name === 'ResourceInUseException' ) {
400- this . serverlessLog ( `DynamoDB - Warn - table ${ migration . TableName } already exists` ) ;
401- resolve ( ) ;
402- } else {
403- this . serverlessLog ( "DynamoDB - Error - " , err ) ;
404- reject ( err ) ;
405- }
397+ await dynamodb . raw . send ( new CreateTableCommand ( migration ) ) . then ( ( ) => {
398+ this . serverlessLog ( "DynamoDB - created table " + migration . TableName ) ;
399+ return migration ;
400+ } ) . catch ( ( err ) => {
401+ if ( err . name === 'ResourceInUseException' ) {
402+ this . serverlessLog ( `DynamoDB - Warn - table ${ migration . TableName } already exists` ) ;
403+ return ;
406404 } else {
407- this . serverlessLog ( "DynamoDB - created table " + migration . TableName ) ;
408- resolve ( migration ) ;
405+ this . serverlessLog ( "DynamoDB - Error - " , err ) ;
406+ throw err ;
409407 }
410408 } )
411409 }
You can’t perform that action at this time.
0 commit comments