Change failed trace from using 504 to instead use 422

This commit is contained in:
Björkan
2026-04-30 23:03:08 +02:00
parent 9f6c0f12c5
commit f710a1f2d9
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -462,7 +462,7 @@ async def request_trace(public_key: str) -> TraceResponse:
)
if event is None:
raise HTTPException(status_code=504, detail="No trace response heard")
raise HTTPException(status_code=422, detail="No trace response heard")
trace = event.payload
path = trace.get("path", [])
+2 -2
View File
@@ -561,7 +561,7 @@ async def trace_path(request: RadioTraceRequest) -> RadioTraceResponse:
try:
event = await asyncio.wait_for(response_task, timeout=timeout_seconds)
except TimeoutError as exc:
raise HTTPException(status_code=504, detail="No trace response heard") from exc
raise HTTPException(status_code=422, detail="No trace response heard") from exc
finally:
if not response_task.done():
response_task.cancel()
@@ -569,7 +569,7 @@ async def trace_path(request: RadioTraceRequest) -> RadioTraceResponse:
await response_task
if event is None:
raise HTTPException(status_code=504, detail="No trace response heard")
raise HTTPException(status_code=422, detail="No trace response heard")
payload = event.payload if isinstance(event.payload, dict) else {}
path_len = payload.get("path_len")