File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,9 @@ class ServerlessDynamodbLocal {
161
161
config && config . start ,
162
162
this . options
163
163
) ;
164
+
165
+ // otherwise endHandler will be mis-informed
166
+ this . options = options ;
164
167
if ( ! options . noStart ) {
165
168
dynamodbLocal . start ( options ) ;
166
169
}
@@ -245,8 +248,13 @@ class ServerlessDynamodbLocal {
245
248
}
246
249
dynamodb . raw . createTable ( migration , ( err ) => {
247
250
if ( err ) {
248
- this . serverlessLog ( "DynamoDB - Error - " , err ) ;
249
- reject ( err ) ;
251
+ if ( err . name === 'ResourceInUseException' ) {
252
+ this . serverlessLog ( `DynamoDB - Warn - table ${ migration . TableName } already exists` ) ;
253
+ resolve ( ) ;
254
+ } else {
255
+ this . serverlessLog ( "DynamoDB - Error - " , err ) ;
256
+ reject ( err ) ;
257
+ }
250
258
} else {
251
259
this . serverlessLog ( "DynamoDB - created table " + migration . TableName ) ;
252
260
resolve ( migration ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " serverless-dynamodb-local" ,
3
- "version" : " 0.2.24 " ,
3
+ "version" : " 0.2.25 " ,
4
4
"engines" : {
5
5
"node" : " >=4.0"
6
6
},
You can’t perform that action at this time.
0 commit comments