Logo Search packages:      
Sourcecode: tagcoll version File versions  Download package

Tagcoll::Exception Class Reference

#include <Exception.h>

Inheritance diagram for Tagcoll::Exception:

Tagcoll::ContextException Tagcoll::ConsistencyCheckException Tagcoll::InterruptedException Tagcoll::ParserException Tagcoll::SystemException Tagcoll::WaitInterruptedException Tagcoll::ParserInputException Tagcoll::FileException Tagcoll::ValOutOfRangeException< C >

List of all members.

Detailed Description

Base class for all exceptions

This is the root of the exception hierarchy. The goal of this hierarchy is to provide the most possible information on what caused the exception at the least possible cost for the programmer.

Every exception is the descendent of Exception that, in turn, extends the std::exception class of the STL.

The base class interface provides an interface to get a (hopefully detailed) textual description of the exception, and a tag describing the type of exception. Further functionality will be provided by subclassers

Further descendents of Exception add functionality and automatisms to error message generation:

Example exception raising:

            void MyFile::open(const char* fname) throw (FileException)
                  if ((fd = open(fname, O_RDONLY)) == -1)
                        throw FileException(errno, stringf::fmt("opening %s read-only", fname));

Example exception catching:

      try {
            } catch (FileException& e) {
                  fprintf(stderr, "%.*s: aborting.\n", PFSTR(e.toString()));

Definition at line 111 of file Exception.h.

Public Member Functions

virtual std::string desc () const throw ()
 Get a string describing what happened that threw the exception.
virtual const char * type () const throw ()
 Get a string tag identifying the exception type.
virtual const char * what () const throw ()
 Get a string describing what happened that threw the exception, STL style.

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index