0
我在這裏的情況。我正在使用一個npm郵件通知模塊。它的工作正常。但當登錄失敗時,我不知道該怎麼辦。Npm郵件通知程序錯誤處理
我的代碼是
var imap = {
user: "[email protected]",
password: "pass",
host: "imap.host.com"
};
notifier(imap).on('mail', function(mail) {
test(mail);
}).start();
notifier(imap).on('error', function(err) {
test(err);
console.log("Error Occured");
});
這是工作正常時,登錄正確。但我無法很好地處理錯誤。當錯誤發生時,我想誤差函數進行工作
感謝