ts_ids_core.errors module

Exceptions used throughout ts_ids_core.

exception InvalidArrayShape[source]

Bases: ValueError

A multidimensional array has an invalid shape.

exception InvalidField[source]

Bases: 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.

exception InvalidForeignKeyField[source]

Bases: InvalidField

Invalid foreign key field definition.

exception InvalidForeignKeySchema[source]

Bases: ValueError

Invalid foreign key schema when creating JSON schema.

exception InvalidNonMandatoryField[source]

Bases: InvalidField

The Non-Mandatory Field of an IDS class is invalid.

exception InvalidPrimaryKeyField[source]

Bases: InvalidField

Invalid primary key field definition.

exception InvalidSchemaMetadata[source]

Bases: ValueError

Raised when the IDS’ JSON Schema contains an invalid top-level metadata value.

exception InvalidTypeError[source]

Bases: TypeError

Field has an invalid type.

exception MultipleTypesError[source]

Bases: TypeError

Field which should have one type has multiple types.

exception NullableReferenceError[source]

Bases: ValueError

fields that contain a reference cannot be nullable.

exception SchemaValidationError[source]

Bases: ValueError

Raised when a value is not consistent with the schema.

exception UnimplementedAbstractField[source]

Bases: InvalidField

An abstract field is being used when instead a subclass should implement it in order to use it.

exception WrongConstantError[source]

Bases: ValueError

Raised when the user passes a value to an abstract ‘const’ field.