      exception
      Copyright (c)  2015 John Abbott
      GNU Free Documentation License, Version 1.2
%!includeconf: ../aux-txt2tags/config.t2t
      TeXTitle{exception}{John Abbott}


== Examples ==[examples]
%----------------------------------------------------------------------
- [ex-error1.C ../../examples/index.html#ex-error1.C]
-

== User documentation ==
%======================================================================

All exceptions thrown by CoCoALib are of a type derived from ``CoCoA::exception``.

An object of type ``CoCoA::exception`` contains just 2 fields: a ``message`` and
a ``context`` (which may be empty).  The intention is that the ``message``
indicates what caused the exception, while ``context`` may indicate where
the exception was thrown from.

Note that ``CoCoA::exception`` does not derive from ``std::exception``.


=== Constructors and pseudo-constructors ===[constructors]
%----------------------------------------------------------------------

There are two constructors:
- ``exception(mesg)``  specify the message but no context
- ``exception(mesg, where)``  specify the message and a context
-

=== Queries and views ===[queries]
%----------------------------------------------------------------------
Let ``E`` be an object of type ``exception``
- ``message(E)``  gives the message inside ``E`` as a ``std::string``
- ``context(E)``  gives the context info inside ``E`` as a ``std::string``
-



== Maintainer documentation ==
%======================================================================

The class is very simple: it contains just two string data members,
and two accessor functions.


== Bugs, shortcomings and other ideas ==
%======================================================================

Is it better to use ``std::string`` or plain C strings?


== Main changes ==
%======================================================================

**2015**
- July (v0.99536): first release


