[docs]classMultipleTypesError(TypeError):"""Field which should have one type has multiple types."""
[docs]classInvalidTypeError(TypeError):"""Field has an invalid type."""
[docs]classNullableReferenceError(ValueError):"""fields that contain a reference cannot be nullable."""
[docs]classWrongConstantError(ValueError):"""Raised when the user passes a value to an abstract 'const' field."""
[docs]classInvalidSchemaMetadata(ValueError):"""Raised when the IDS' JSON Schema contains an invalid top-level metadata value."""
[docs]classInvalidField(Exception):""" Invalid definition for the IDS field. Note that this error should only be raised during class creation. Raise a ``ValueError`` for invalid field values, e.g. in the body of a ``@field_validator`` method. """
[docs]classInvalidNonMandatoryField(InvalidField):"""The Non-Mandatory Field of an IDS class is invalid."""
[docs]classUnimplementedAbstractField(InvalidField):"""An abstract field is being used when instead a subclass should implement it in order to use it."""
[docs]classSchemaValidationError(ValueError):"""Raised when a value is not consistent with the schema."""
[docs]classInvalidPrimaryKeyField(InvalidField):"""Invalid primary key field definition."""
[docs]classInvalidForeignKeyField(InvalidField):"""Invalid foreign key field definition."""
[docs]classInvalidForeignKeySchema(ValueError):"""Invalid foreign key schema when creating JSON schema."""
[docs]classInvalidArrayShape(ValueError):"""A multidimensional array has an invalid shape."""def__init__(self):self.message=("An array with a non-uniform shape was found where a multidimensional ""array was expected. It must have the same length in every element of ""every dimension to be a valid multidimensional array.")super().__init__(self.message)