Skip to content

Commit

Permalink
Show better UnsupportedQueryError. (bluesky#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielballan authored Jun 14, 2023
1 parent 0d8b250 commit af69257
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tiled/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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."
},
)

Expand Down

0 comments on commit af69257

Please sign in to comment.