08-02-2020, 21:11
Line 430 - 443:
You change it like this:
Comment the "try" and the whole "except" section then the script will crash with the "real" error message. Otherwise it is always hidden behind de exception.
Code:
try:
# call sendmail() and generate a new mail with specified subject and content
if EnableDebug == 1:
print "Sending Email."
sendmail(str(receiver),'Wetterstation error',str(datetime.now().strftime("%d.%m.%Y %H:%M:%S")) + ' No data is logged since 10 minutes')
if EnableErrorLog == 1:
with open(ErrorLog,'a') as err:
err.write (str(datetime.now().strftime("%d.%m.%Y %H:%M:%S")) +" Mail sent to " + str(receiver) + "\n")
mailSent = 1
except:
if EnableErrorLog == 1:
with open(ErrorLog,'a') as err:
err.write (str(datetime.now().strftime("%d.%m.%Y %H:%M:%S")) +" Mail could not be sent. \n")
mailSent = 1You change it like this:
Code:
# try:
# call sendmail() and generate a new mail with specified subject and content
if EnableDebug == 1:
print "Sending Email."
sendmail(str(receiver),'Wetterstation error',str(datetime.now().strftime("%d.%m.%Y %H:%M:%S")) + ' No data is logged since 10 minutes')
if EnableErrorLog == 1:
with open(ErrorLog,'a') as err:
err.write (str(datetime.now().strftime("%d.%m.%Y %H:%M:%S")) +" Mail sent to " + str(receiver) + "\n")
mailSent = 1
#except:
#if EnableErrorLog == 1:
#with open(ErrorLog,'a') as err:
#err.write (str(datetime.now().strftime("%d.%m.%Y %H:%M:%S")) +" Mail could not be sent. \n")
#mailSent = 1Comment the "try" and the whole "except" section then the script will crash with the "real" error message. Otherwise it is always hidden behind de exception.

