Skip to content

Commit 7d65534

Browse files
anlu85olofk
authored andcommitted
Improves error message context for validation errors
Updates validation error messages to include the absolute path of the error. This provides more context for debugging and understanding where the validation failed, especially for complex data structures. Also modifies error message for root level errors.
1 parent 2528ce7 commit 7d65534

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core_directory/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,4 +327,4 @@ def _format_core_validation_error(self, e, file_type):
327327
key = '::'.join(e.absolute_path)
328328
default_message = {'default': e.message}
329329
error_message = validator_error_messages.get(key, default_message).get(e.validator, e.message)
330-
return f'Validation error in {file_type} file at {key or 'root'}: {error_message}'
330+
return f'Validation error in {file_type} file at {key or "root"}: {error_message}'

0 commit comments

Comments
 (0)