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

Exception.h File Reference


Detailed Description

This file provides 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.

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 {
                  myfile.open("/tmp/foo");
            } catch (FileException& e) {
                  fprintf(stderr, "%.*s: aborting.\n", PFSTR(e.toString()));
                  exit(1);
            }

Definition in file Exception.h.

#include <string>
#include <stringf.h>

Go to the source code of this file.

Classes

class  ConsistencyCheckException
 Exception thrown when some consistency check fails. More...
class  ContextException
 Exception with a description of the throwing context. More...
class  Exception
 Base class for all exceptions. More...
class  FileException
 Base class for exceptions for file I/O. More...
class  InstallUnexpected
class  InterruptedException
class  OutOfRangeException
class  SystemException
 Base class for system exceptions. More...
class  ValOutOfRangeException< C >
 Exception thrown when index checking fails. More...
class  WaitInterruptedException
 Exception thrown when some system wait is interrupted by a signal. More...

Functions

void DefaultUnexpected ()
 Basic unexpected handler.


Generated by  Doxygen 1.6.0   Back to index