Spaces:
Sleeping
Sleeping
Commit
·
a1e07be
1
Parent(s):
21e3ede
implemented error handling for getFen route
Browse files- __pycache__/main.cpython-311.pyc +0 -0
- main.py +3 -3
__pycache__/main.cpython-311.pyc
CHANGED
Binary files a/__pycache__/main.cpython-311.pyc and b/__pycache__/main.cpython-311.pyc differ
|
|
main.py
CHANGED
@@ -93,10 +93,10 @@ async def get_fen(file : UploadFile = File(), perspective : str = "w", next_to_m
|
|
93 |
if perspective not in ["w" , "b"]:
|
94 |
return JSONResponse(content={"error" : "Perspective should be w (white) or b (black)"}, status_code=500)
|
95 |
|
96 |
-
if
|
97 |
-
return JSONResponse(content={"error" : "
|
98 |
-
|
99 |
|
|
|
100 |
try:
|
101 |
image_content = await file.read()
|
102 |
if not image_content:
|
|
|
93 |
if perspective not in ["w" , "b"]:
|
94 |
return JSONResponse(content={"error" : "Perspective should be w (white) or b (black)"}, status_code=500)
|
95 |
|
96 |
+
if next_to_move not in ["w" , "b"]:
|
97 |
+
return JSONResponse(content={"error" : "next to move should be w (white) or b (black)"}, status_code=500)
|
|
|
98 |
|
99 |
+
|
100 |
try:
|
101 |
image_content = await file.read()
|
102 |
if not image_content:
|