some more error detection code
This commit is contained in:
@@ -226,7 +226,16 @@ def createstravaworkoutdata(w):
|
||||
# to rowing on Strava
|
||||
def handle_stravaexport(file,workoutname,stravatoken,description=''):
|
||||
# w = Workout.objects.get(id=workoutid)
|
||||
client = stravalib.Client(access_token=stravatoken)
|
||||
try:
|
||||
client = stravalib.Client(access_token=stravatoken)
|
||||
except:
|
||||
with open("media/stravaerrors.log","a") as errorlog:
|
||||
errorstring = str(sys.exc_info()[0])
|
||||
timestr = time.strftime("%Y%m%d-%H%M%S")
|
||||
errorlog.write(timestr+errorstring+"\r\n")
|
||||
errorlog.write("stravastuff.py line 236\r\n")
|
||||
return 0
|
||||
|
||||
try:
|
||||
act = client.upload_activity(file,'tcx',name=workoutname)
|
||||
res = act.wait(poll_interval=5.0)
|
||||
|
||||
Reference in New Issue
Block a user