Skip to content

Commit

Permalink
Merge pull request #256 from sennetconsortium/tjmadonna/1125-more-inf…
Browse files Browse the repository at this point in the history
…ormative-logs

Tjmadonna/1125 more informative logs
  • Loading branch information
maxsibilla authored Jan 9, 2024
2 parents e688681 + 7fdcbf1 commit bed9411
Show file tree
Hide file tree
Showing 2 changed files with 367 additions and 132 deletions.
18 changes: 18 additions & 0 deletions src/lib/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
def create_trigger_error_msg(msg: str, existing_data_dict: dict, new_data_dict: dict) -> str:
"""Creates an error message for a schema trigger function by appending additional
useful information to the message.
Args:
msg (str): The message to display before the additional information.
existing_data_dict (dict): The existing data.
new_data_dict (dict): The new data.
Returns:
str: The error message.
"""
return (
f"{msg} "
f"UUID: {existing_data_dict.get('uuid') or new_data_dict.get('uuid')} "
f"SenNet ID: {existing_data_dict.get('sennet_id') or new_data_dict.get('sennet_id')} "
f"Entity type: {existing_data_dict.get('entity_type') or new_data_dict.get('entity_type')}"
)
Loading

0 comments on commit bed9411

Please sign in to comment.