Logtalk reference manual
Built-in method: type_error/2
Contents > Reference Manual > Built-in Methods > type_error/2

## type_error/2

#### Description

    type_error(Type, Culprit)

Throws an `error(type_error(Type,Culprit), logtalk(Head,Context))` exception term where `Head` is the head of the clause from where this predicate is called and `Context` is the execution context of the call. This built-in predicate is declared as a private method and thus cannot be used as a message to an object.

#### Template and modes

    type_error(+nonvar,+term)

#### Errors

`(none)`

#### Examples

`(none)`

#### See also

`catch/3`, `throw/1`, `context/1`
`instantiation_error/0`, `domain_error/2`, `existence_error/2`, `permission_error/3`, `representation_error/1`, `evaluation_error/1`, `resource_error/1`