SimplyKnownAsG / yamlize

Python YAML serializing library
Apache License 2.0
11 stars 5 forks source link

Failed validation is too noisy #5

Closed youngmit closed 3 years ago

youngmit commented 4 years ago

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 commented 4 years ago

@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 commented 3 years ago

closing due to inactivity