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

@ -208,6 +208,17 @@ def test_table_json(app_client):
}]
def test_table_not_exists_json(app_client):
assert {
'ok': False,
'error': 'Table not found: blah',
'status': 404,
'title': None,
} == app_client.get(
'/test_tables/blah.json', gather_request=False
).json
def test_jsono_redirects_to_shape_objects(app_client):
response_1 = app_client.get(
'/test_tables/simple_primary_key.jsono',