summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Cheng-Han2016-10-10 20:56:41 +0800
committerWu Cheng-Han2016-10-10 20:56:41 +0800
commit4ea5191d308881cf067f1183ca78f9bf805c7668 (patch)
tree34d0e0a1e096b360d95efd14dff302190070ae89
parentd6d2cf978aed8f7abeb93d0393c9d04a4a06bd4e (diff)
Fix fatal error should throw instead of return
-rw-r--r--app.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app.js b/app.js
index 26c099eb..b877bc8f 100644
--- a/app.js
+++ b/app.js
@@ -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);