Commit 2bf9a556 authored by Pierre Dittgen's avatar Pierre Dittgen Committed by Christophe Benz

Display nice error on invalid schema URL

parent c3af7627
...@@ -522,7 +522,16 @@ def custom_validator(): ...@@ -522,7 +522,16 @@ def custom_validator():
# url of resource to be validated # url of resource to be validated
url_param = request.args.get("url") url_param = request.args.get("url")
schema_instance = SchemaInstance.from_parameters(request.args, schema_catalog_map) schema_instance = None
schema_instance = SchemaInstance.from_parameters(request.args, schema_catalog_map)
except json.JSONDecodeError as e:
flash_error("Format de schéma non reconnu")
return redirect(url_for('home'))
except Exception as e:
flash_error("Erreur lors de l'obtention du schéma")
return redirect(url_for('home'))
if schema_instance is None: if schema_instance is None:
flash_error("Aucun schéma passé en paramètre") flash_error("Aucun schéma passé en paramètre")
return redirect(url_for('home')) return redirect(url_for('home'))
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment