goalie.CheckTypeError

exception goalie.CheckTypeError(value: object, expected: str, name: str | None = None)

Bases: CheckError, TypeError

A value has the wrong type.

Examples

>>> try:
...     raise CheckTypeError(1, "a string", name="prefix")
... except TypeError as e:
...     str(e)
'prefix must be a string, got 1.'