Skip to content

Commit d09e9ed

Browse files
committed
Print the full location
1 parent a4600ef commit d09e9ed

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cppython/core/resolution.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,10 @@ def resolve_model[T: BaseModel](model: type[T], data: dict[str, Any]) -> T:
262262
logging.getLogger('cppython').debug('ValidationError details: %s', e.errors())
263263

264264
if e.errors():
265-
formatted_errors = '\n'.join(f"Field '{error['loc'][0]}': {error['msg']}" for error in e.errors())
265+
formatted_errors = '\n'.join(
266+
f"Field '{'.'.join(map(str, error['loc']))}': {error['msg']}"
267+
for error in e.errors(include_input=True, include_context=True)
268+
)
266269
else:
267270
formatted_errors = 'An unknown validation error occurred.'
268271

0 commit comments

Comments
 (0)