{"record":{"id":"6a080336e3a9eab2","repo":"deepset-ai/haystack","slug":"either-pipeline-snapshot-or-break-point-must-be-pr","errorCode":null,"errorMessage":"Either pipeline_snapshot or break_point must be provided.","messagePattern":"Either pipeline_snapshot or break_point must be provided\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"haystack/core/errors.py","lineNumber":127,"sourceCode":"    \"\"\"\n\n    def __init__(\n        self,\n        message: str,\n        component: str | None = None,\n        pipeline_snapshot: PipelineSnapshot | None = None,\n        pipeline_snapshot_file_path: str | None = None,\n        *,\n        break_point: Breakpoint | None = None,\n    ) -> None:\n        super().__init__(message)\n        self.component = component\n        self.pipeline_snapshot = pipeline_snapshot\n        self.pipeline_snapshot_file_path = pipeline_snapshot_file_path\n        self._break_point = break_point\n\n        if self.pipeline_snapshot is None and self._break_point is None:\n            raise ValueError(\"Either pipeline_snapshot or break_point must be provided.\")\n\n    @classmethod\n    def from_triggered_breakpoint(cls, break_point: Breakpoint) -> \"BreakpointException\":\n        \"\"\"\n        Create a BreakpointException from a triggered breakpoint.\n        \"\"\"\n        msg = f\"Breaking at component {break_point.component_name} at visit count {break_point.visit_count}\"\n        return BreakpointException(message=msg, component=break_point.component_name, break_point=break_point)\n\n    @property\n    def inputs(self) -> dict[str, Any] | None:\n        \"\"\"\n        Returns the current inputs of the pipeline at the breakpoint.\n        \"\"\"\n        if not self.pipeline_snapshot:\n            return None\n        return self.pipeline_snapshot.pipeline_state.inputs\n","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/core/errors.py#L109-L145","documentation":"A BreakpointException carries pipeline state for resuming, so it must know either an in-memory pipeline_snapshot or a break_point from which a snapshot can be loaded. The constructor raises ValueError when both are None because the exception would have no state to resume from.","triggerScenarios":"Constructing BreakpointException(component=..., pipeline_snapshot=None, pipeline_snapshot_file_path=None, break_point=None) directly — typically from custom debugging/breakpoint tooling that forgot to attach either piece of state.","commonSituations":"Custom pipeline debugging harnesses building BreakpointException manually; a wrapper swallowing the original exception then re-raising a fresh BreakpointException without copying snapshot/break_point; loading a snapshot file path that was deleted and passing None for both.","solutions":["Pass either a pipeline_snapshot (PipelineSnapshot) or a break_point (Breakpoint) to the constructor","Use the classmethod BreakpointException.from_triggered_breakpoint(break_point) instead of __init__","If a snapshot file path is used, verify the file exists and load the snapshot before raising"],"exampleFix":"// before\nraise BreakpointException(component=bp.component)\n\n// after\nraise BreakpointException.from_triggered_breakpoint(bp)  # or pass pipeline_snapshot=snapshot","handlingStrategy":"validation","validationCode":"def make_breakpoint_exception(component, snapshot=None, break_point=None, path=None):\n    if snapshot is None and break_point is None:\n        raise ValueError(\"Provide pipeline_snapshot or break_point before constructing BreakpointException\")\n    return BreakpointException(component=component, pipeline_snapshot=snapshot, break_point=break_point, pipeline_snapshot_file_path=path)","typeGuard":"def can_build_breakpoint_exception(snapshot, break_point) -> bool:\n    return snapshot is not None or break_point is not None","tryCatchPattern":"try:\n    exc = BreakpointException(component=c)\nexcept ValueError as e:\n    logging.error(\"BreakpointException needs snapshot or break_point: %s\", e)\n    exc = BreakpointException.from_triggered_breakpoint(bp)","preventionTips":["Prefer BreakpointException.from_triggered_breakpoint over direct construction","Never build BreakpointException manually after swallowing the original one","Verify snapshot files exist before relying on pipeline_snapshot_file_path"],"tags":["python","breakpoints","debugging","pipeline-resume","haystack"],"backgroundTag":"missing-required-argument","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}