Commit 5b18fc90 authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

catch and display headermissingerror

parent 052e64fd
......@@ -14,10 +14,11 @@ from pathlib import Path
from urllib.parse import quote_plus
from backports.datetime_fromisoformat import MonkeyPatch
from commonmark import commonmark
from flask import make_response, redirect, render_template, request, url_for
import tabulator
import validata_core
from commonmark import commonmark
from validata_core import compute_badge, csv_helpers, messages
from validata_core.loaders import custom_loaders
......@@ -253,6 +254,10 @@ def validate(schema_code, source: ValidataSource):
flash_error('Erreur : format de fichier non supporté')
return redirect(url_for('scdl_validator', val_code=schema_code))
except validata_core.MissingHeaderError:
flash_error("Erreur : impossible d'extraire les données d'entête du fichier source")
return redirect(url_for('scdl_validator', val_code=schema_code))
# Computes badge from report and badge configuration
badge = compute_badge(validata_core_report, config.BADGE_CONFIG)
badge_url, badge_msg = get_badge_url_and_message(badge)
Supports Markdown
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