-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
attrs-parserenhancementNew feature or request thereforNew feature or request thereforunder considerationDev has not yet decided whether or how to implementDev has not yet decided whether or how to implement
Milestone
Description
Post #52:
Add a DefectsField
field type for collecting errors raised during parsing and decoding
-
By default, errors are stored as a
dict
that maps header field names to lists of exceptions- What should happen for scanner and body errors?
- Idea: Don't catch scanner errors … for now
- Idea: Store them in the
dict
with the key set to aSCANNING
orBODY
enum or token - Idea: Wrap all decoder errors in custom
DecoderError
instances- Subclasses:
FieldDecoderError(post-alias-name, value, error)
ExtraFieldsDecoderError(value, error)
BodyDecoderError(value, error)
- Subclasses:
- What should happen for scanner and body errors?
-
Non-extra fields can now take a
required: bool
parameter so that lack of a required field can be caught & registered as a defect -
Errors are stored after calling
.with_traceback(None)
on them and their chain of causes (__cause__
) & contexts (__context__
) in order to reduce memory use -
Should defects mode be toggleable by an option when
parse*()
is called?
Metadata
Metadata
Assignees
Labels
attrs-parserenhancementNew feature or request thereforNew feature or request thereforunder considerationDev has not yet decided whether or how to implementDev has not yet decided whether or how to implement