Skip to content

Commit

Permalink
improves error message for contrib validated save
Browse files Browse the repository at this point in the history
  • Loading branch information
Kircheneer committed Oct 28, 2024
1 parent cb072ee commit 0f2c3dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes/590.changed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved error message for validated save in contrib model.
4 changes: 3 additions & 1 deletion nautobot_ssot/contrib/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ def _update_obj_with_parameters(cls, obj, parameters, adapter):
try:
obj.validated_save()
except ValidationError as error:
raise ObjectCrudException(f"Validated save failed for Django object. Parameters: {parameters}") from error
raise ObjectCrudException(
f"Validated save failed for Django object:\n{error}\nParameters: {parameters}"
) from error

# Handle relationship association creation. This needs to be after object creation, because relationship
# association objects rely on both sides already existing.
Expand Down

0 comments on commit 0f2c3dc

Please sign in to comment.