Skip to content

Commit

Permalink
raise error if any exception statuses at the end of a pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
rbiseck3 committed Jun 24, 2024
1 parent 139bf77 commit 45a3233
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions unstructured/ingest/v2/pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
from unstructured.ingest.v2.processes.partitioner import PartitionerConfig


class PipelineError(Exception):
pass


@dataclass
class Pipeline:
context: ProcessorConfig
Expand Down Expand Up @@ -119,6 +123,8 @@ def run(self):
finally:
self.log_statuses()
self.cleanup()
if self.context.status:
raise PipelineError("Pipeline did not run successfully")

def clean_results(self, results: Optional[list[Union[Any, list[Any]]]]) -> Optional[list[Any]]:
if not results:
Expand Down

0 comments on commit 45a3233

Please sign in to comment.