Exceptions
- exception headerparser.Error[source]
Bases:
Exception
Superclass for all custom exceptions raised by the package
Parser Errors
- exception headerparser.ParserError[source]
Bases:
Error
,ValueError
Superclass for all custom exceptions related to errors in parsing
- exception headerparser.BodyNotAllowedError[source]
Bases:
ParserError
Raised when
body=False
and the parser encounters a message body
- exception headerparser.DuplicateFieldError(name: str)[source]
Bases:
ParserError
Raised when a header field not marked as multiple occurs two or more times in the input
- exception headerparser.FieldTypeError(name: str, value: str, exc_value: BaseException)[source]
Bases:
ParserError
Raised when a
type
callable raises an exception- exc_value: BaseException
The exception raised by the
type
callable
- exception headerparser.InvalidChoiceError(name: str, value: Any)[source]
Bases:
ParserError
Raised when a header field is given a value that is not one of its allowed choices
- exception headerparser.MissingBodyError[source]
Bases:
ParserError
Raised when
body=True
but there is no message body in the input
- exception headerparser.MissingFieldError(name: str)[source]
Bases:
ParserError
Raised when a header field marked as required is not present in the input
Scanner Errors
- exception headerparser.ScannerError[source]
Bases:
Error
,ValueError
Superclass for all custom exceptions related to errors in scanning
- exception headerparser.MalformedHeaderError(line: str)[source]
Bases:
ScannerError
Raised when the scanner encounters an invalid header line, i.e., a line without either a colon or leading whitespace
- exception headerparser.UnexpectedFoldingError(line: str)[source]
Bases:
ScannerError
Raised when the scanner encounters a folded (indented) line that is not preceded by a valid header line