def error404(error): _add_cors_headers(response) response.set_header('Content-Type', 'application/json') return json.dumps({'detail': 'Page not found'})