Skip to content

Commit

Permalink
šŸ› (data.py): refactor error message handling in data_to_text_list funā€¦
Browse files Browse the repository at this point in the history
ā€¦ction to improve readability and maintainability
  • Loading branch information
Cristhianzl committed Feb 23, 2025
1 parent 14ad99d commit 4c1a326
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/backend/base/langflow/helpers/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def data_to_text_list(template: str, data: Data | list[Data]) -> tuple[list[str]
formatted_text.append(template.format_map(safe_dict))
processed_data.append(data_obj)
except ValueError as e:
raise ValueError(f"Error formatting template: {e!s}") from e
msg = f"Error formatting template: {e!s}"
raise ValueError(msg) from e

return formatted_text, processed_data

Expand Down

0 comments on commit 4c1a326

Please sign in to comment.