Skip to content

Commit b353f2d

Browse files
committed
Fix silently failing SQLite exception #176
* Add a catch statement to catch exceptions during the promise transaction when creating the SQLite database Signed-off-by: Jillian Daguil <[email protected]>
1 parent 0e16dbe commit b353f2d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

assets/app/js/aboutCodeDB.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ class AboutCodeDB {
285285
.then(() => {
286286
files = [];
287287
this.resume();
288-
});
288+
})
289+
.catch(e => reject(e));
289290
}
290291
})
291292
.on('end', () => {
@@ -353,7 +354,7 @@ class AboutCodeDB {
353354
return license;
354355
});
355356
});
356-
this.License.bulkCreate(licenses || [], options);
357+
return this.License.bulkCreate(licenses || [], options);
357358
})
358359
.then(() => {
359360
let copyrights = $.map(files, file => {
@@ -362,7 +363,7 @@ class AboutCodeDB {
362363
return copyright;
363364
});
364365
});
365-
this.Copyright.bulkCreate(copyrights || [], options);
366+
return this.Copyright.bulkCreate(copyrights || [], options);
366367
})
367368
.then(() => {
368369
let packages = $.map(files, file => {
@@ -371,7 +372,7 @@ class AboutCodeDB {
371372
return pkg;
372373
});
373374
});
374-
this.Package.bulkCreate(packages || [], options);
375+
return this.Package.bulkCreate(packages || [], options);
375376
})
376377
.then(() => {
377378
let emails = $.map(files, file => {
@@ -380,7 +381,7 @@ class AboutCodeDB {
380381
return email;
381382
});
382383
});
383-
this.Email.bulkCreate(emails || [], options);
384+
return this.Email.bulkCreate(emails || [], options);
384385
})
385386
.then(() => {
386387
let urls = $.map(files, file => {
@@ -389,7 +390,7 @@ class AboutCodeDB {
389390
return url;
390391
});
391392
});
392-
this.Url.bulkCreate(urls || [], options);
393+
return this.Url.bulkCreate(urls || [], options);
393394
})
394395
.then(() => {
395396
return this.sequelize.Promise.each(files, file => {

0 commit comments

Comments
 (0)