#include <BALL/COMMON/exception.h>
Inherits std::exception.
Inherited by BALL::Bit::IllegalOperation, BALL::Bond::NotBound, BALL::Client::InvalidClient, BALL::Client::NoPersistentObject, BALL::EnumeratorIndex::IncompatibleIndex, BALL::Exception::BufferOverflow, BALL::Exception::CUDAError, BALL::Exception::DivisionByZero, BALL::Exception::FileNotFound, BALL::Exception::FormatUnsupported, BALL::Exception::IllegalPosition, BALL::Exception::IllegalSelfOperation, BALL::Exception::IllegalTreeOperation, BALL::Exception::IncompatibleIterators, BALL::Exception::IndexOverflow, BALL::Exception::IndexUnderflow, BALL::Exception::InvalidArgument, BALL::Exception::InvalidFormat, BALL::Exception::InvalidIterator, BALL::Exception::InvalidOption, BALL::Exception::InvalidRange, BALL::Exception::InvalidSize, BALL::Exception::MatrixHasWrongDimension, BALL::Exception::MatrixIsSingular, BALL::Exception::MatrixNotQuadratic, BALL::Exception::MatrixNotRegular, BALL::Exception::NoBufferAvailable, BALL::Exception::NotImplemented, BALL::Exception::NullPointer, BALL::Exception::OutOfGrid, BALL::Exception::OutOfMemory, BALL::Exception::OutOfRange, BALL::Exception::ParseError, BALL::Exception::Postcondition, BALL::Exception::Precondition, BALL::Exception::SingularIterator, BALL::Exception::SizeUnderflow, BALL::Exception::TooManyBonds, BALL::Exception::TooManyErrors, BALL::Exception::Uninitialized, BALL::Exception::VectorHasWrongDimension, BALL::File::CannotWrite, BALL::FragmentDB::NoFragmentNode, BALL::HashMap< Key, T >::IllegalKey, BALL::HashSet< Key >::IllegalKey, BALL::QSAR::Exception::ConfigurationReadingError, BALL::QSAR::Exception::FeatureSelectionParameterError, BALL::QSAR::Exception::InconsistentUsage, BALL::QSAR::Exception::InvalidActivityID, BALL::QSAR::Exception::KernelParameterError, BALL::QSAR::Exception::ModelParameterError, BALL::QSAR::Exception::NoPCAVariance, BALL::QSAR::Exception::PropertyError, BALL::QSAR::Exception::SingularMatrixError, BALL::QSAR::Exception::TooManyPLSComponents, BALL::QSAR::Exception::WrongDataType, BALL::QSAR::Exception::WrongFileFormat, BALL::RMSDMinimizer::IncompatibleCoordinateSets, BALL::RMSDMinimizer::TooFewCoordinates, BALL::Substring::InvalidSubstring, BALL::Substring::UnboundSubstring, BALL::VIEW::ColorUnit::NotInHexFormat, BALL::VIEW::GLDisplayList::DisplayListRedeclaration, BALL::VIEW::GLDisplayList::NestedDisplayList, BALL::VIEW::GLDisplayList::NoDisplayListAvailable, BALL::VIEW::GLRenderer::WrongModes, and BALL::VIEW::ServerWidget::NotCompositeObject.
Public Member Functions | |
Constructors and Destructors | |
GeneralException () | |
Default constructor. | |
GeneralException (const char *file, int line) | |
Constructor. | |
GeneralException (const char *file, int line, const String &name, const String &message) | |
Constructor. | |
GeneralException (const GeneralException &exception) | |
Copy constructor. | |
virtual | ~GeneralException () throw () |
Destructor. | |
Accessors | |
const char * | getName () const |
Returns the name of the exception. | |
const char * | getMessage () const |
Returns the error message of the exception. | |
void | setMessage (const std::string &message) |
Modify the exception's error message. | |
int | getLine () const |
Returns the line number where it occured. | |
const char * | getFile () const |
Returns the file where it occured. | |
Protected Attributes | |
const char * | file_ |
int | line_ |
std::string | name_ |
std::string | message_ |
General exception class. This class is intended as a base class for all other exceptions. Each exception class should define a constructor taking a string and an int as parameters. These two values are interpreted as the current filename and line number and is usually printed in case of an uncaught exception. To support this feature, each throw directive should look as follows:
throw Exception::GeneralException(__FILE__, __LINE__);
__FILE__
and __LINE__
are built-in preprocessor macros that hold the desired information. cerr
and Log , and finally calls exits the program cleanly (with exit code 1). This can be rather inconvenient for debugging, since you are told where the exception was thrown, but in general you do not know anything about the context. Therefore terminate
can also create a core dump. Using a debugger (e.g. dbx or gdb) you can then create a stack traceback. To create a core dump, you should set the environment variable BALL_DUMP_CORE
to any (non empty) value. Definition at line 54 of file COMMON/exception.h.
BALL::Exception::GeneralException::GeneralException | ( | ) |
Default constructor.
BALL::Exception::GeneralException::GeneralException | ( | const char * | file, | |
int | line | |||
) |
Constructor.
BALL::Exception::GeneralException::GeneralException | ( | const char * | file, | |
int | line, | |||
const String & | name, | |||
const String & | message | |||
) |
Constructor.
BALL::Exception::GeneralException::GeneralException | ( | const GeneralException & | exception | ) |
Copy constructor.
virtual BALL::Exception::GeneralException::~GeneralException | ( | ) | throw () [virtual] |
Destructor.
const char* BALL::Exception::GeneralException::getFile | ( | ) | const |
Returns the file where it occured.
int BALL::Exception::GeneralException::getLine | ( | ) | const |
Returns the line number where it occured.
const char* BALL::Exception::GeneralException::getMessage | ( | ) | const |
Returns the error message of the exception.
const char* BALL::Exception::GeneralException::getName | ( | ) | const |
Returns the name of the exception.
void BALL::Exception::GeneralException::setMessage | ( | const std::string & | message | ) |
Modify the exception's error message.
const char* BALL::Exception::GeneralException::file_ [protected] |
Definition at line 102 of file COMMON/exception.h.
int BALL::Exception::GeneralException::line_ [protected] |
Definition at line 103 of file COMMON/exception.h.
std::string BALL::Exception::GeneralException::message_ [protected] |
Definition at line 106 of file COMMON/exception.h.
std::string BALL::Exception::GeneralException::name_ [protected] |
Definition at line 105 of file COMMON/exception.h.