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 {
161161 config && config . start ,
162162 this . options
163163 ) ;
164+
165+ // otherwise endHandler will be mis-informed
166+ this . options = options ;
164167 if ( ! options . noStart ) {
165168 dynamodbLocal . start ( options ) ;
166169 }
@@ -245,8 +248,13 @@ class ServerlessDynamodbLocal {
245248 }
246249 dynamodb . raw . createTable ( migration , ( err ) => {
247250 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+ }
250258 } else {
251259 this . serverlessLog ( "DynamoDB - created table " + migration . TableName ) ;
252260 resolve ( migration ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " serverless-dynamodb-local" ,
3- "version" : " 0.2.24 " ,
3+ "version" : " 0.2.25 " ,
44 "engines" : {
55 "node" : " >=4.0"
66 },
You can’t perform that action at this time.
0 commit comments