Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

pass key to DictNode fields for error reporting #26

Merged
merged 1 commit into from
Jun 2, 2017

Conversation

davegaeddert
Copy link
Member

This improves error reporting a bit by passing the name that a dict field was given down to the child node (like WildcardDictNode does) so that it can reference itself by the name it was given, not just by its class name, which may not be the same.

'foo must be a str' instead of 'dummyfoo must be a str'

Sidenote, I also clarified the behavior of is_valid, which at least in the case of DictNode does not factor in the validity of its descendants. Not sure if that should be explored or not, I could see it both ways...I think the way that it is makes for more clear error reporting again? The dict itself may be just fine, and have the fields it is required to have, and then if a field has the wrong type then the error will only show up on that field, not on the field and the parent dict.

@paulortman
Copy link
Collaborator

👍

@davegaeddert davegaeddert merged commit 70d5967 into master Jun 2, 2017
@davegaeddert davegaeddert deleted the dict-field-key-name branch June 2, 2017 15:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants