[O] Don't 200 error

This commit is contained in:
2024-12-17 00:54:38 -05:00
parent 3d48caada0
commit c0114401c8
2 changed files with 9 additions and 4 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ import random
from fastapi.responses import RedirectResponse
import uvicorn
from subprocess import check_output
from fastapi import FastAPI, Request
from fastapi import FastAPI, HTTPException, Request
from fastapi.middleware.cors import CORSMiddleware
from pathlib import Path
@@ -61,7 +61,7 @@ async def input_request(request: Request):
async def get_puzzle(id: str):
tf = data / f"{id}.json"
if not tf.exists():
return {"error": "Puzzle not found"}
raise HTTPException(status_code=404, detail="Puzzle not found")
return json.loads(tf.read_text())