Exceptions

In addition to success and failure, a program may give an exception that is explicitly thrown by a call of throw/1, is raised by a built-in, or is caused by the user typing ^C. An exception that is raised by a built-in is a one-argument structure, where the functor shows the type of the exception, and the argument shows the source of the exception.5.1

The following lists some of the exceptions:

The exception that is caused by the typing of ^C is an atom named interrupt.

An exception that is not caught by a program will be handled by the system. The system reports the type and the source of the exception, and aborts execution of the query. For example, for the query a=:=1, the system will report:

   ***  error(type_error(evaluable,a/0),=:=/2)
where evaluable is the type, and =:=/2 is the source.

Neng-Fa Zhou 2013-01-25