Private
Public Access
1
0

refined Strava error logging

This commit is contained in:
Sander Roosendaal
2017-01-09 14:34:04 +01:00
parent af9662edac
commit aec79544ec

View File

@@ -929,6 +929,15 @@ def workout_strava_upload_view(request,id=0):
res = stravastuff.handle_stravaexport(f,w.name,
r.stravatoken,
description=w.notes)
except:
with open("media/stravaerrors.log","a") as errorlog:
errorstring = str(sys.exc_info()[0])
timestr = strftime("%Y%m%d-%H%M%S")
errorlog.write(timestr+errorstring+"\r\n")
errorlog.write("views.py line 937\r\n")
message = 'Error: '+errorstring
res = 0
try:
w.uploadedtostrava = res
w.save()
os.remove(tcxfile)
@@ -939,7 +948,7 @@ def workout_strava_upload_view(request,id=0):
errorstring = str(sys.exc_info()[0])
timestr = strftime("%Y%m%d-%H%M%S")
errorlog.write(timestr+errorstring+"\r\n")
errorlog.write("views.py line 946\r\n")
errorlog.write("views.py line 952\r\n")
message = 'Error: '+errorstring