Better mechanism for handling errors; 404s for missing table/database

New error mechanism closes #193

404s for missing tables/databesse closes #184

Makes pull request #202 unnecessary.
This commit is contained in:
Simon Willison 2018-04-13 11:17:22 -07:00
commit 9f28bbe43d
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
6 changed files with 101 additions and 42 deletions

View file

@ -20,17 +20,19 @@
<div class="ft">
Powered by <a href="https://github.com/simonw/datasette" title="Datasette v{{ datasette_version }}">Datasette</a>
{% if query_ms %}&middot; Query took {{ query_ms|round(3) }}ms{% endif %}
{% if metadata.license or metadata.license_url %}&middot; Data license:
{% if metadata.license_url %}
<a href="{{ metadata.license_url }}">{{ metadata.license or metadata.license_url }}</a>
{% else %}
{{ metadata.license }}
{% if metadata %}
{% if metadata.license or metadata.license_url %}&middot; Data license:
{% if metadata.license_url %}
<a href="{{ metadata.license_url }}">{{ metadata.license or metadata.license_url }}</a>
{% else %}
{{ metadata.license }}
{% endif %}
{% endif %}
{% if metadata.source or metadata.source_url %}&middot;
Data source: {% if metadata.source_url %}
<a href="{{ metadata.source_url }}">
{% endif %}{{ metadata.source or metadata.source_url }}{% if metadata.source_url %}</a>{% endif %}
{% endif %}
{% endif %}
{% if metadata.source or metadata.source_url %}&middot;
Data source: {% if metadata.source_url %}
<a href="{{ metadata.source_url }}">
{% endif %}{{ metadata.source or metadata.source_url }}{% if metadata.source_url %}</a>{% endif %}
{% endif %}
</div>
{% if select_templates %}<!-- Templates considered: {{ select_templates|join(", ") }} -->{% endif %}