Skip to content

Commit

Permalink
Merge pull request #590 from Kircheneer/improve-contrib-error-messaging
Browse files Browse the repository at this point in the history
improves error message for contrib validated save
  • Loading branch information
Kircheneer authored Oct 28, 2024
2 parents cb072ee + 0f2c3dc commit 5c714a1
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 5c714a1

Please sign in to comment.