Commit b4065d92 authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

Handle source encoding error

parent b291beca
......@@ -19,6 +19,7 @@ from validata_core.helpers import (
FileContentValidataResource,
URLValidataResource,
ValidataResource,
ValidataSourceError,
is_body_error,
is_structure_error,
)
......@@ -361,7 +362,13 @@ def validate(schema_instance: SchemaInstance, validata_resource: ValidataResourc
}
# Parse source data once
header, rows = validata_resource.extract_tabular_data()
try:
header, rows = validata_resource.extract_tabular_data()
except ValidataSourceError as err:
flash_error(f"Erreur de lecture du fichier source : {err.message}")
return redirect(
compute_validation_form_url(schema_instance.request_parameters())
)
rows_count = len(rows)
# Call validata_core with parsed data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment