Exceptions#

exception MandatoryFieldMissing#

Exception raised when a mandatory field is missing

__init__(field, message="This field has no value provided whereas it's mandatory")#

Constructor of the class

Parameters
  • field (str) – Field that is empty

  • message (str, optional) – Custom string to show when the exception occurs.

  • mandatory" (... Defaults to "This field has no value provided whereas it's) –

Examples

>>> raise MandatoryFieldMissing("uid or name")
exception WrongType#

Exception raised when the type is not expected

__init__(value, expected_type, message='This value has not the expected type')#

Constructor of the class

Parameters
  • value (str) – Field that is concerned

  • expected_type (str) – Expected type

  • message (str, optional) – Custom string to show when the exception occurs.

  • type" (... Defaults to "This value has not the expected) –

Examples

>>> raise WrongType(value="value1", expected_type=int)