Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed validation is too noisy #5

Closed
youngmit opened this issue Jan 2, 2020 · 2 comments
Closed

Failed validation is too noisy #5

youngmit opened this issue Jan 2, 2020 · 2 comments

Comments

@youngmit
Copy link

youngmit commented Jan 2, 2020

The broad execpt clause in attributes.py:

try:
    self.set_value(obj, value)
except Exception as ee:
    raise YamlizingError('Failed to assign attribute `{}` to `{}`, '
                         'got: {}'
                         .format(self.name, value, ee), node)

staples an extra exception on top of the more easily-digested ValueError from the __set__ method. It might be best to just let ValueErrors through.

@SimplyKnownAsG
Copy link
Owner

@youngmit, can you provide an MWE? The YamlizingError provides the context (node start and end) of the associated error. This is a key feature of yamlize: tracking errors to the line of a yaml file. Is there another way to accomplish this?

@SimplyKnownAsG
Copy link
Owner

closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants