dataclass_builder.exceptions module

Exceptions for the package.

exception dataclass_builder.exceptions.DataclassBuilderError[source]

Bases: Exception

Base class of errors raised by DataclassBuilder.

exception dataclass_builder.exceptions.UndefinedFieldError(message: str, dataclass: Any, field: str)[source]

Bases: dataclass_builder.exceptions.DataclassBuilderError

Exception thrown when attempting to assign to an invalid field.

Parameters
  • message – Human readable error message

  • dataclassdataclasses.dataclass() the DataclassBuilder was made for.

  • field – Name of the invalid field that the calling code tried to assign to.

dataclass

dataclasses.dataclass() the DataclassBuilder was made for.

field

Name of the invalid field that the calling code tried to assign to.

exception dataclass_builder.exceptions.MissingFieldError(message: str, dataclass: Any, field: Field[Any])[source]

Bases: dataclass_builder.exceptions.DataclassBuilderError

Thrown when fields are missing when building a dataclasses.dataclass().

Parameters
  • message – Human readable error message

  • dataclassdataclasses.dataclass() the DataclassBuilder was made for.

  • field – The dataclasses.Field representing the missing field that needs to be assigned.

dataclass

dataclasses.dataclass() the DataclassBuilder was made for.

field

The dataclasses.Field representing the missing field that needs to be assigned.