Spaces:
Sleeping
Sleeping
Update backend/main.py
Browse files- backend/main.py +6 -0
backend/main.py
CHANGED
|
@@ -408,8 +408,14 @@ async def analyze(files: List[UploadFile] = File(...)):
|
|
| 408 |
|
| 409 |
# Extract each paper
|
| 410 |
for path, name in zip(tmp_paths, paper_names):
|
|
|
|
| 411 |
result = extract_protocol(client, path, name)
|
| 412 |
extracted.append(result)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 413 |
|
| 414 |
# Compare
|
| 415 |
comparison = compare_protocols(client, extracted, paper_names)
|
|
|
|
| 408 |
|
| 409 |
# Extract each paper
|
| 410 |
for path, name in zip(tmp_paths, paper_names):
|
| 411 |
+
try:
|
| 412 |
result = extract_protocol(client, path, name)
|
| 413 |
extracted.append(result)
|
| 414 |
+
except Exception as e:
|
| 415 |
+
raise HTTPException(
|
| 416 |
+
status_code=500,
|
| 417 |
+
detail=f"Failed to process {name}: {str(e)}"
|
| 418 |
+
)
|
| 419 |
|
| 420 |
# Compare
|
| 421 |
comparison = compare_protocols(client, extracted, paper_names)
|