make task failure log more consistent with 'marking task as failed' (#782)
This commit is contained in:
@@ -382,7 +382,7 @@ class ForgeAgent:
|
|||||||
raise
|
raise
|
||||||
except StepTerminationError as e:
|
except StepTerminationError as e:
|
||||||
LOG.warning(
|
LOG.warning(
|
||||||
"Step cannot be executed. Task failed.",
|
"Step cannot be executed, marking task as failed",
|
||||||
task_id=task.task_id,
|
task_id=task.task_id,
|
||||||
step_id=step.step_id,
|
step_id=step.step_id,
|
||||||
exc_info=True,
|
exc_info=True,
|
||||||
@@ -442,7 +442,7 @@ class ForgeAgent:
|
|||||||
return step, detailed_output, None
|
return step, detailed_output, None
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.exception(
|
LOG.exception(
|
||||||
"Got an unexpected exception in step, fail the task",
|
"Got an unexpected exception in step, marking task as failed",
|
||||||
task_id=task.task_id,
|
task_id=task.task_id,
|
||||||
step_id=step.step_id,
|
step_id=step.step_id,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -104,12 +104,12 @@ async def task_stream(
|
|||||||
except ValidationError as e:
|
except ValidationError as e:
|
||||||
await websocket.send_text(f"Invalid data: {e}")
|
await websocket.send_text(f"Invalid data: {e}")
|
||||||
except WebSocketDisconnect:
|
except WebSocketDisconnect:
|
||||||
LOG.info("WebSocket connection closed")
|
LOG.info("WebSocket connection closed", task_id=task_id, organization_id=organization_id)
|
||||||
except ConnectionClosedOK:
|
except ConnectionClosedOK:
|
||||||
LOG.info("ConnectionClosedOK error while streaming", exc_info=True)
|
LOG.info("ConnectionClosedOK error while streaming", task_id=task_id, organization_id=organization_id)
|
||||||
return
|
return
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.warning("Error while streaming", exc_info=True)
|
LOG.warning("Error while streaming", task_id=task_id, organization_id=organization_id)
|
||||||
return
|
return
|
||||||
LOG.info("WebSocket connection closed successfully")
|
LOG.info("WebSocket connection closed successfully", task_id=task_id, organization_id=organization_id)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user