API - update messages on gpx related errors

This commit is contained in:
Sam 2022-07-13 09:49:04 +02:00
parent 0eaae0e171
commit f5881763ae
2 changed files with 5 additions and 5 deletions

View File

@ -586,7 +586,7 @@ class TestPostWorkoutWithGpx(ApiTestCaseMixin, CallArgsMixin):
),
)
data = self.assert_500(response, 'Error during gpx processing.')
data = self.assert_500(response, 'error during gpx processing')
assert 'data' not in data
def test_it_returns_500_if_gpx_has_invalid_xml(
@ -615,7 +615,7 @@ class TestPostWorkoutWithGpx(ApiTestCaseMixin, CallArgsMixin):
),
)
data = self.assert_500(response, 'Error during gpx file parsing.')
data = self.assert_500(response, 'error during gpx file parsing')
assert 'data' not in data
def test_it_returns_400_if_workout_gpx_has_invalid_extension(
@ -954,7 +954,7 @@ class TestPostWorkoutWithZipArchive(ApiTestCaseMixin):
),
)
data = self.assert_500(response, 'Error during gpx processing.')
data = self.assert_500(response, 'error during gpx processing')
assert 'data' not in data
def test_it_imports_only_max_number_of_files(

View File

@ -307,9 +307,9 @@ def process_one_gpx_file(
absolute_map_filepath = get_absolute_file_path(map_filepath)
generate_map(absolute_map_filepath, map_data)
except (gpxpy.gpx.GPXXMLSyntaxException, TypeError) as e:
raise WorkoutException('error', 'Error during gpx file parsing.', e)
raise WorkoutException('error', 'error during gpx file parsing', e)
except Exception as e:
raise WorkoutException('error', 'Error during gpx processing.', e)
raise WorkoutException('error', 'error during gpx processing', e)
try:
new_workout = create_workout(