error catching around non painsled parsers
This commit is contained in:
@@ -610,7 +610,15 @@ def new_workout_from_file(r,f2,
|
||||
|
||||
# handle non-Painsled by converting it to painsled compatible CSV
|
||||
if (fileformat != 'csv'):
|
||||
f2,summary,oarlength,inboard = handle_nonpainsled(f2,fileformat,summary=summary)
|
||||
try:
|
||||
f2,summary,oarlength,inboard = handle_nonpainsled(f2,
|
||||
fileformat,
|
||||
summary=summary)
|
||||
except:
|
||||
errorstring = str(sys.exc_info()[0])
|
||||
message = 'Something went wrong: '+errorstring
|
||||
return (0,message,'')
|
||||
|
||||
|
||||
|
||||
dosummary = (fileformat != 'fit')
|
||||
|
||||
@@ -5132,10 +5132,10 @@ def workout_upload_view(request,message="",
|
||||
f2 = res[1] # file name incl media directory
|
||||
|
||||
|
||||
id,message,f2 = dataprep.new_workout_from_file(r,f2,
|
||||
workouttype=workouttype,
|
||||
makeprivate=makeprivate,
|
||||
title = t,
|
||||
id,message,f2 = dataprep.new_workout_from_file(r,f2,
|
||||
workouttype=workouttype,
|
||||
makeprivate=makeprivate,
|
||||
title = t,
|
||||
notes='')
|
||||
if not id:
|
||||
url = reverse(workout_upload_view,
|
||||
|
||||
Reference in New Issue
Block a user