[fix] Recovered mail message + onError

This commit is contained in:
2019-06-11 13:29:22 +02:00
parent 774cdb1daf
commit eab4fcb71a

View File

@@ -61,9 +61,23 @@ export const mail = {
console.log('Connection recovered')
await sendMail(conf.mail, '[dwatcher] Connection recovered', `
<p>
Connection to ${target} was lost on ${moment().format('dd-MM-YYYY HH:mm:ss')}.
Connection to ${target} was recovered on ${moment().format('dd-MM-YYYY HH:mm:ss')}.
</p>
`)
}
},
onError: (conf: Conf, target: string) => {
return async (e: Error) => {
console.error(e.message || e)
// await sendMail(conf.mail, '[dwatcher] Connection error', `
// <p>
// Connection error with ${target} on ${moment().format('dd-MM-YYYY HH:mm:ss')}:
// </p>
// <p>
// ${e.message}
// </p>
// `)
}
}
}