[enh] validate input and raise an exception inside search.py. The exception message is output in json and rss format.

This commit is contained in:
Alexandre Flament 2017-01-20 18:52:47 +01:00
parent 7fdfeca3a4
commit 15eef0ebdb
4 changed files with 133 additions and 38 deletions

View file

@ -11,6 +11,12 @@
<opensearch:itemsPerPage>{{ number_of_results }}</opensearch:itemsPerPage>
<atom:link rel="search" type="application/opensearchdescription+xml" href="{{ base_url }}opensearch.xml"/>
<opensearch:Query role="request" searchTerms="{{ q|e }}" startPage="1" />
{% if error_message %}
<item>
<title>Error</title>
<description>{{ error_message|e }}</description>
</item>
{% endif %}
{% for r in results %}
<item>
<title>{{ r.title }}</title>