API & Client - update error message on workout save error

This commit is contained in:
Sam 2023-03-08 10:57:04 +01:00
parent 1a62a968a5
commit ac6605c5c9
3 changed files with 4 additions and 3 deletions

View File

@ -8,7 +8,6 @@ from uuid import UUID
import gpxpy.gpx
import pytz
from flask import current_app
from sqlalchemy import exc
from werkzeug.datastructures import FileStorage
from werkzeug.utils import secure_filename
@ -352,9 +351,9 @@ def process_one_gpx_file(
db.session.add(new_segment)
db.session.commit()
return new_workout
except (exc.IntegrityError, ValueError) as e:
except Exception as e:
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:

View File

@ -8,6 +8,7 @@
"error during gpx file parsing": "Error during gpx file parsing.",
"error during gpx processing": "Error during gpx processing.",
"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, please try again or contact the administrator": "Error, please try again or contact the administrator.",
"error, registration is disabled": "Error, registration is disabled.",

View File

@ -8,6 +8,7 @@
"error during gpx file parsing": "Erreur lors de l'analyse du fichier.",
"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 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, 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.",