diff --git a/dist/controller/notifiesController.js b/dist/controller/notifiesController.js index d68a792..54c2c05 100644 --- a/dist/controller/notifiesController.js +++ b/dist/controller/notifiesController.js @@ -39,7 +39,7 @@ var NotifyController = /** @class */ (function () { if (!isAlive) { $notify.save(function (err) { if (err) - throw err; + throw Error("Notify \u5132\u5B58\u5931\u6557\uFF1A " + err); }); } else { @@ -49,7 +49,7 @@ var NotifyController = /** @class */ (function () { }; notify_1.NotifyModel.findOneAndUpdate({ userId: userId }, userObj, function (err, _) { if (err) - console.log(err); + throw Error("Notify \u66F4\u65B0\u5931\u6557: " + err); }); } }); diff --git a/dist/controller/users/binding.js b/dist/controller/users/binding.js index 28e88f9..3c4da77 100644 --- a/dist/controller/users/binding.js +++ b/dist/controller/users/binding.js @@ -73,7 +73,7 @@ function userBinding(context, _a) { user.save(function (err) { if (err) { sendMessage_1.default(context, '❌ 綁定失敗'); - return; + throw Error("\u5E33\u865F\u7D81\u5B9A\u5931\u6557: " + err); } }); } diff --git a/src/controller/notifiesController.ts b/src/controller/notifiesController.ts index 763e6a2..bb4991d 100644 --- a/src/controller/notifiesController.ts +++ b/src/controller/notifiesController.ts @@ -35,7 +35,7 @@ class NotifyController { $notify.userId = userId; if (!isAlive) { $notify.save(err => { - if (err) throw err; + if (err) throw Error(`Notify 儲存失敗: ${err}`); }); } else { const userObj = { @@ -46,7 +46,7 @@ class NotifyController { { userId: userId }, userObj, (err, _) => { - if (err) console.log(err); + if (err) throw Error(`Notify 更新失敗: ${err}`); } ); }