AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Fix block execution status in case of error (#8267)
vishesh107b92bae9424d
diff --git a/autogpt_platform/backend/backend/data/block.py b/autogpt_platform/backend/backend/data/block.pyindex 02ae317911..554dfc237c 100644--- a/autogpt_platform/backend/backend/data/block.py+++ b/autogpt_platform/backend/backend/data/block.py@@ -272,6 +272,8 @@ class Block(ABC, Generic[BlockSchemaInputType, BlockSchemaOutputType]):for output_name, output_data in self.run(self.input_schema(**input_data), **kwargs):+ if "error" in output_name:+ raise ValueError(output_data)if error := self.output_schema.validate_field(output_name, output_data):raise ValueError(f"Block produced an invalid output data: {error}")yield output_name, output_data