Get notified if an error occurred in scheduler

I have set a cronjob in erpnext that everyday a reminder is sent to absent employees, but when they does not get executed due to some error, for example the email template was not set.
I have made this check in the code but how do I generate an error log so that I get notified through it that email template was not set hence emails were not sent?
Is there some function through which I can generate error log based on condition?