• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

deepset-ai / haystack / 17432604695

03 Sep 2025 11:54AM UTC coverage: 92.051% (-0.03%) from 92.079%
17432604695

Pull #9759

github

web-flow
Merge a59e01427 into f48789f5f
Pull Request #9759: feat: Add PipelineTool to streamline using Pipeline as Tools with Agent

12970 of 14090 relevant lines covered (92.05%)

0.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.88
haystack/core/errors.py
1
# SPDX-FileCopyrightText: 2022-present deepset GmbH <info@deepset.ai>
2
#
3
# SPDX-License-Identifier: Apache-2.0
4

5
from typing import Any, Optional
1✔
6

7
from haystack.dataclasses.breakpoints import PipelineSnapshot
1✔
8

9

10
class PipelineError(Exception):
1✔
11
    pass
1✔
12

13

14
class PipelineRuntimeError(Exception):
1✔
15
    def __init__(
1✔
16
        self,
17
        component_name: Optional[str],
18
        component_type: Optional[type],
19
        message: str,
20
        pipeline_snapshot: Optional[PipelineSnapshot] = None,
21
    ) -> None:
22
        self.component_name = component_name
1✔
23
        self.component_type = component_type
1✔
24
        self.pipeline_snapshot = pipeline_snapshot
1✔
25
        super().__init__(message)
1✔
26

27
    @classmethod
1✔
28
    def from_exception(cls, component_name: str, component_type: type, error: Exception) -> "PipelineRuntimeError":
1✔
29
        """
30
        Create a PipelineRuntimeError from an exception.
31
        """
32
        message = (
1✔
33
            f"The following component failed to run:\n"
34
            f"Component name: '{component_name}'\n"
35
            f"Component type: '{component_type.__name__}'\n"
36
            f"Error: {str(error)}"
37
        )
38
        return cls(component_name, component_type, message)
1✔
39

40
    @classmethod
1✔
41
    def from_invalid_output(cls, component_name: str, component_type: type, output: Any) -> "PipelineRuntimeError":
1✔
42
        """
43
        Create a PipelineRuntimeError from an invalid output.
44
        """
45
        message = (
1✔
46
            f"The following component returned an invalid output:\n"
47
            f"Component name: '{component_name}'\n"
48
            f"Component type: '{component_type.__name__}'\n"
49
            f"Expected a dictionary, but got {type(output).__name__} instead.\n"
50
            f"Check the component's output and ensure it is a valid dictionary."
51
        )
52
        return cls(component_name, component_type, message)
1✔
53

54

55
class PipelineComponentsBlockedError(PipelineRuntimeError):
1✔
56
    def __init__(self) -> None:
1✔
57
        message = (
×
58
            "Cannot run pipeline - all components are blocked. "
59
            "This typically happens when:\n"
60
            "1. There is no valid entry point for the pipeline\n"
61
            "2. There is a circular dependency preventing the pipeline from running\n"
62
            "Check the connections between these components and ensure all required inputs are provided."
63
        )
64
        super().__init__(None, None, message)
×
65

66

67
class PipelineConnectError(PipelineError):
1✔
68
    pass
1✔
69

70

71
class PipelineValidationError(PipelineError):
1✔
72
    pass
1✔
73

74

75
class PipelineDrawingError(PipelineError):
1✔
76
    pass
1✔
77

78

79
class PipelineMaxComponentRuns(PipelineError):
1✔
80
    pass
1✔
81

82

83
class PipelineUnmarshalError(PipelineError):
1✔
84
    pass
1✔
85

86

87
class ComponentError(Exception):
1✔
88
    pass
1✔
89

90

91
class ComponentDeserializationError(Exception):
1✔
92
    pass
1✔
93

94

95
class DeserializationError(Exception):
1✔
96
    pass
1✔
97

98

99
class SerializationError(Exception):
1✔
100
    pass
1✔
101

102

103
class BreakpointException(Exception):
1✔
104
    """
105
    Exception raised when a pipeline breakpoint is triggered.
106
    """
107

108
    def __init__(
1✔
109
        self,
110
        message: str,
111
        component: Optional[str] = None,
112
        inputs: Optional[dict[str, Any]] = None,
113
        results: Optional[dict[str, Any]] = None,
114
    ):
115
        super().__init__(message)
1✔
116
        self.component = component
1✔
117
        self.inputs = inputs
1✔
118
        self.results = results
1✔
119

120

121
class PipelineInvalidPipelineSnapshotError(Exception):
1✔
122
    """
123
    Exception raised when a pipeline is resumed from an invalid snapshot.
124
    """
125

126
    def __init__(self, message: str):
1✔
127
        super().__init__(message)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc