Add a field type for storing parsing defects #53
Labels
attrs-parser
enhancement
New feature or request therefor
under consideration
Dev has not yet decided whether or how to implement
Milestone
Post #52:
Add a
DefectsField
field type for collecting errors raised during parsing and decodingBy default, errors are stored as a
dict
that maps header field names to lists of exceptionsdict
with the key set to aSCANNING
orBODY
enum or tokenDecoderError
instancesFieldDecoderError(post-alias-name, value, error)
ExtraFieldsDecoderError(value, error)
BodyDecoderError(value, error)
Non-extra fields can now take a
required: bool
parameter so that lack of a required field can be caught & registered as a defectErrors are stored after calling
.with_traceback(None)
on them and their chain of causes (__cause__
) & contexts (__context__
) in order to reduce memory useShould defects mode be toggleable by an option when
parse*()
is called?The text was updated successfully, but these errors were encountered: