Skip to content

Commit 473f7be

Browse files
committed
Change Pipeline.from_dict error message
1 parent fb42c03 commit 473f7be

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Diff for: haystack/core/pipeline/base.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,16 @@ def from_dict(
176176

177177
try:
178178
instance = component_from_dict(component_class, component_data, name, callbacks)
179-
except Exception as e:
179+
except Exception as error:
180180
msg = (
181-
f"Couldn't deserialize component '{name}' of class '{component_class.__name__}' "
182-
f"with the following data: {str(component_data)}. Possible reasons include "
183-
"malformed serialized data, mismatch between the serialized component and the "
184-
"loaded one (due to a breaking change, see "
185-
"https://github.com/deepset-ai/haystack/releases), etc."
181+
f"Couldn't deserialize component '{name}' of class '{component_class.__name__}' because of:"
182+
f"{error}"
183+
"Component was deserialized with the following data:"
184+
f"{str(component_data)}."
185+
"Possible reasons include malformed serialized data, mismatch between the serialized component "
186+
"and the loaded one (due to a breaking change, see https://github.com/deepset-ai/haystack/releases), etc."
186187
)
187-
raise DeserializationError(msg) from e
188+
raise DeserializationError(msg) from error
188189
pipe.add_component(name=name, instance=instance)
189190

190191
for connection in data.get("connections", []):

0 commit comments

Comments
 (0)