API & Client - update error message on workout save error
This commit is contained in:
parent
1a62a968a5
commit
ac6605c5c9
@ -8,7 +8,6 @@ from uuid import UUID
|
|||||||
import gpxpy.gpx
|
import gpxpy.gpx
|
||||||
import pytz
|
import pytz
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from sqlalchemy import exc
|
|
||||||
from werkzeug.datastructures import FileStorage
|
from werkzeug.datastructures import FileStorage
|
||||||
from werkzeug.utils import secure_filename
|
from werkzeug.utils import secure_filename
|
||||||
|
|
||||||
@ -352,9 +351,9 @@ def process_one_gpx_file(
|
|||||||
db.session.add(new_segment)
|
db.session.add(new_segment)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
return new_workout
|
return new_workout
|
||||||
except (exc.IntegrityError, ValueError) as e:
|
except Exception as e:
|
||||||
delete_files(absolute_gpx_filepath, absolute_map_filepath)
|
delete_files(absolute_gpx_filepath, absolute_map_filepath)
|
||||||
raise WorkoutException('fail', 'Error during workout save.', e)
|
raise WorkoutException('error', 'error when saving workout', e)
|
||||||
|
|
||||||
|
|
||||||
def is_gpx_file(filename: str) -> bool:
|
def is_gpx_file(filename: str) -> bool:
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
"error during gpx file parsing": "Error during gpx file parsing.",
|
"error during gpx file parsing": "Error during gpx file parsing.",
|
||||||
"error during gpx processing": "Error during gpx processing.",
|
"error during gpx processing": "Error during gpx processing.",
|
||||||
"error on getting configuration": "Error on getting configuration.",
|
"error on getting configuration": "Error on getting configuration.",
|
||||||
|
"error when saving workout": "Error when saving workout.",
|
||||||
"error when updating configuration": "Error when updating configuration",
|
"error when updating configuration": "Error when updating configuration",
|
||||||
"error, please try again or contact the administrator": "Error, please try again or contact the administrator.",
|
"error, please try again or contact the administrator": "Error, please try again or contact the administrator.",
|
||||||
"error, registration is disabled": "Error, registration is disabled.",
|
"error, registration is disabled": "Error, registration is disabled.",
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
"error during gpx file parsing": "Erreur lors de l'analyse du fichier.",
|
"error during gpx file parsing": "Erreur lors de l'analyse du fichier.",
|
||||||
"error during gpx processing": "Erreur lors du traitement du fichier gpx.",
|
"error during gpx processing": "Erreur lors du traitement du fichier gpx.",
|
||||||
"error on getting configuration": "Erreur lors de la récupération de la configuration.",
|
"error on getting configuration": "Erreur lors de la récupération de la configuration.",
|
||||||
|
"error when saving workout": "Erreur lors de l'enregistrement de la séance.",
|
||||||
"error when updating configuration": "Erreur lors de la mise à jour de la configuration",
|
"error when updating configuration": "Erreur lors de la mise à jour de la configuration",
|
||||||
"error, please try again or contact the administrator": "Erreur, veuillez réessayer ou contacter l'administrateur.",
|
"error, please try again or contact the administrator": "Erreur, veuillez réessayer ou contacter l'administrateur.",
|
||||||
"error, registration is disabled": "Erreur, les inscriptions sont désactivées.",
|
"error, registration is disabled": "Erreur, les inscriptions sont désactivées.",
|
||||||
|
Loading…
Reference in New Issue
Block a user