[fix] Recovered mail message + onError
This commit is contained in:
@@ -61,9 +61,23 @@ export const mail = {
|
|||||||
console.log('Connection recovered')
|
console.log('Connection recovered')
|
||||||
await sendMail(conf.mail, '[dwatcher] Connection recovered', `
|
await sendMail(conf.mail, '[dwatcher] Connection recovered', `
|
||||||
<p>
|
<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>
|
</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>
|
||||||
|
// `)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user