diff options
author | Wu Cheng-Han | 2016-10-10 20:56:41 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2016-10-10 20:56:41 +0800 |
commit | 4ea5191d308881cf067f1183ca78f9bf805c7668 (patch) | |
tree | 34d0e0a1e096b360d95efd14dff302190070ae89 | |
parent | d6d2cf978aed8f7abeb93d0393c9d04a4a06bd4e (diff) |
Fix fatal error should throw instead of return
-rw-r--r-- | app.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -484,7 +484,7 @@ models.sequelize.sync().then(function () { // check if realtime is ready if (history.isReady() && realtime.isReady()) { models.Revision.checkAllNotesRevision(function (err, notes) { - if (err) return new Error(err); + if (err) throw new Error(err); if (!notes || notes.length <= 0) return startListen(); }); } @@ -511,7 +511,7 @@ process.on('SIGINT', function () { var checkCleanTimer = setInterval(function () { if (history.isReady() && realtime.isReady()) { models.Revision.checkAllNotesRevision(function (err, notes) { - if (err) return new Error(err); + if (err) throw new Error(err); if (notes.length <= 0) { clearInterval(checkCleanTimer); return process.exit(0); |