/usr/lib/swipl/library/exceptions.pl
All Application Manual Name SummaryHelp

  • swipl
    • library
      • error.pl
      • debug.pl
      • apply.pl
      • lists.pl
      • broadcast.pl
      • shlib.pl -- Utility library for loading foreign objects (DLLs, shared objects)
      • option.pl -- Option list processing
      • thread_pool.pl
      • gensym.pl
      • settings.pl
      • arithmetic.pl
      • main.pl
      • readutil.pl
      • operators.pl
      • pairs.pl
      • prolog_source.pl
      • record.pl
      • quasi_quotations.pl
      • sandbox.pl
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • yall.pl -- Lambda expressions
      • assoc.pl
      • prolog_format.pl
      • pure_input.pl -- Pure Input from files and streams
      • solution_sequences.pl
      • ordsets.pl
      • random.pl -- Random numbers
      • base64.pl -- Base64 encoding and decoding
      • aggregate.pl -- Aggregation operators on backtrackable predicates
      • predicate_options.pl
      • csv.pl -- Process CSV (Comma-Separated Values) data
      • pprint.pl
      • atom.pl
      • modules.pl
      • occurs.pl
      • prolog_xref.pl
      • prolog_colour.pl -- Prolog syntax colouring support.
      • lazy_lists.pl
      • ugraphs.pl
      • url.pl -- Analysing and constructing URL
      • www_browser.pl
      • prolog_pack.pl -- A package manager for Prolog
      • git.pl -- Run GIT commands
      • utf8.pl -- UTF-8 encoding/decoding on lists of character codes.
      • quintus.pl -- Quintus compatibility
      • prolog_versions.pl
      • prolog_wrap.pl
      • dialect.pl
      • date.pl
      • persistency.pl
      • iostream.pl -- Utilities to deal with streams
      • prolog_code.pl
      • strings.pl
      • dif.pl
      • edinburgh.pl
      • terms.pl
      • ansi_term.pl
      • threadutil.pl -- Interactive thread utilities
      • prolog_stack.pl
      • prolog_clause.pl
      • prolog_breakpoints.pl
      • wfs.pl
      • sort.pl
      • dicts.pl
      • varnumbers.pl
      • rbtrees.pl -- Red black trees
      • base32.pl
      • charsio.pl
      • codesio.pl
      • coinduction.pl
      • heaps.pl
      • statistics.pl
      • when.pl
      • backcomp.pl
      • ctypes.pl -- Character code classification
      • explain.pl
      • macros.pl
      • listing.pl -- List programs and pretty print clauses
      • vm.pl
      • tables.pl -- XSB interface to tables
      • make.pl
      • hashtable.pl
      • exceptions.pl -- Exception classification
        • catch/4
        • exception/2
        • error_term/2
        • exception_term/2
        • exception_type/2
      • nb_set.pl -- Non-backtrackable sets
      • nb_rbtrees.pl -- Non-backtrackable operations on red black trees
      • increval.pl
      • prolog_debug.pl
      • prolog_trace.pl
      • streams.pl -- Manage Prolog streams
      • thread.pl -- High level thread primitives
      • tableutil.pl
      • readln.pl
      • help.pl
      • intercept.pl -- Intercept and signal interface
      • portray_text.pl
      • prolog_profile.pl
      • system.pl
      • check.pl
      • qsave.pl
      • zip.pl
      • prolog_codewalk.pl -- Prolog code walker
      • prolog_coverage.pl
      • edit.pl
      • prolog_metainference.pl -- Infer meta-predicate properties
      • prolog_config.pl
      • shell.pl
      • check_installation.pl -- Check installation issues and features
      • qpforeign.pl
      • tty.pl
      • oset.pl
      • prolog_jiti.pl
 exception(:Type, --Ball) is det
exception(:Type, +Ball) is semidet
If Ball is unbound, adds a delayed goal that tests the error belongs to Type when Ball is instantiated (by catch/3). Else succeed is error is of the specified Type.

Note that the delayed goal is added using freeze/2 and therefore the stepwise instantiation of Ball does not work, e.g. exception(file_error, error(Formal,_)) immediately fails.

Error types may be defined or extended (e.g., by libraries) by adding clauses to the multifile predicates error_term/2 and exception_term/2. Modules may (re-)define local error types using the exception_type/2 directive.