diff --git a/autogpt_platform/backend/backend/data/graph.py b/autogpt_platform/backend/backend/data/graph.py index 584a929e13..46099e8122 100644 --- a/autogpt_platform/backend/backend/data/graph.py +++ b/autogpt_platform/backend/backend/data/graph.py @@ -355,7 +355,7 @@ class BaseGraph(GraphBaseMeta): "required": [p.name for p in schema_fields if p.value is None], } except AttributeError as e: - raise ValueError(str(e)) from e + raise ValueError(f"Invalid graph schema input: {e}") from e class GraphTriggerInfo(BaseModel): diff --git a/autogpt_platform/backend/backend/data/graph_test.py b/autogpt_platform/backend/backend/data/graph_test.py index 3c4ad15c2b..2064e6a9a3 100644 --- a/autogpt_platform/backend/backend/data/graph_test.py +++ b/autogpt_platform/backend/backend/data/graph_test.py @@ -1477,5 +1477,5 @@ def test_generate_schema_raises_value_error_when_name_missing(): and re-raised as ValueError so the existing 400 handler in rest_api.py fires instead of falling through to the 500 catch-all. """ - with pytest.raises(ValueError): + with pytest.raises(ValueError, match="name"): GraphModel._generate_schema((AgentInputBlock.Input, {}))