exception/3

exception(+ Exception, + Context, - Action)*

Dynamic predicate, normally not defined. Callreded by the Prolog system on run-time exceptions that can be repaired just-in-time. The values for Exception are described below. See also catch//33 and throw//11. If this hook preodicate succeeds it must instantiate the Action argument to the atom fail to make the operation fail silently, retry to tell Prolog to retry the operation or error to make the system generate an exception. The action retry only makes sense if this hook modified the environment such that the operation can now succeed without error.

  • undefined_predicateContext is instantiated to a predicate-indicator ( Module:Name/Arity). If the predicate fails Prolog will generate an existence_error exception. The hook is intended to implement alternatives to the SWI built-in autoloader, such as autoloading code from a database. Do not use this hook to suppress existence errors on predicates. See also unknown.

  • undefined_global_variableContext is instantiated to the name of the missing global variable. The hook must call nb_setval//22 or b_setval//22 before returning with the action retry.

Dynamic predicate, normally not defined. Called by the Prolog system on run-time exceptions that can be repaired just-in-time. The values for Exception are described below. See also catch//33 and throw//11. If this hook preodicate succeeds it must instantiate the Action argument to the atom fail to make the operation fail silently, retry to tell Prolog to retry the operation or error to make the system generate an exception. The action retry only makes sense if this hook modified the environment such that the operation can now succeed without error.

  • undefined_predicateContext is instantiated to a predicate-indicator ( Module:Name/Arity). If the predicate fails Prolog will generate an existence_error exception. The hook is intended to implement alternatives to the SWI built-in autoloader, such as autoloading code from a database. Do not use this hook to suppress existence errors on predicates. See also unknown.

  • undefined_global_variableContext is instantiated to the name of the missing global variable. The hook must call nb_setval//22 or b_setval//22 before returning with the action retry.