From af692573e9001f5cc8f01355356240fd10ea5138 Mon Sep 17 00:00:00 2001 From: Dan Allan Date: Wed, 14 Jun 2023 09:59:08 -0400 Subject: [PATCH] Show better UnsupportedQueryError. (#458) --- tiled/server/app.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tiled/server/app.py b/tiled/server/app.py index 18d806829..0c4fe8223 100644 --- a/tiled/server/app.py +++ b/tiled/server/app.py @@ -29,7 +29,7 @@ from . import schemas from .authentication import get_current_principal from .compression import CompressionMiddleware -from .core import PatchedStreamingResponse, json_or_msgpack +from .core import PatchedStreamingResponse from .dependencies import ( get_query_registry, get_root_tree, @@ -255,11 +255,10 @@ async def index( @app.exception_handler(UnsupportedQueryType) async def unicorn_exception_handler(request: Request, exc: UnsupportedQueryType): query_type = exc.args[0] - return json_or_msgpack( - request, + return JSONResponse( status_code=400, content={ - "detail": f"The query type {query_type} is not supported on this node." + "detail": f"The query type {query_type!r} is not supported on this node." }, )