Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -363,7 +363,7 @@ async def resume_review(payload: HumanInputPayload):
|
|
| 363 |
print("Error: Graph or checkpointer not initialized. Check server logs.")
|
| 364 |
return
|
| 365 |
|
| 366 |
-
|
| 367 |
current_state_snapshot = global_graph.get_state({"configurable": {"thread_id": thread_id_state}})
|
| 368 |
current_state_values = current_state_snapshot.values
|
| 369 |
|
|
@@ -390,7 +390,12 @@ async def resume_review(payload: HumanInputPayload):
|
|
| 390 |
final_state_values = final_state_snapshot.values
|
| 391 |
final_review_id = final_state_values["final_review_id"]
|
| 392 |
final_review_url = final_state_values["final_review_url"]
|
| 393 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 394 |
return
|
| 395 |
|
| 396 |
except Exception as e:
|
|
|
|
| 363 |
print("Error: Graph or checkpointer not initialized. Check server logs.")
|
| 364 |
return
|
| 365 |
|
| 366 |
+
try:
|
| 367 |
current_state_snapshot = global_graph.get_state({"configurable": {"thread_id": thread_id_state}})
|
| 368 |
current_state_values = current_state_snapshot.values
|
| 369 |
|
|
|
|
| 390 |
final_state_values = final_state_snapshot.values
|
| 391 |
final_review_id = final_state_values["final_review_id"]
|
| 392 |
final_review_url = final_state_values["final_review_url"]
|
| 393 |
+
last_error = final_state_values["last_error"]
|
| 394 |
+
|
| 395 |
+
if last_error is not None:
|
| 396 |
+
print(f"final_review_id:{final_review_id}\nfinal_review_url:{final_review_url}")
|
| 397 |
+
else:
|
| 398 |
+
print(f"Encountered error:{last_error} during graph execution")
|
| 399 |
return
|
| 400 |
|
| 401 |
except Exception as e:
|