Gromacs  5.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::InternalError Class Reference

#include <gromacs/utility/exceptions.h>

+ Inheritance diagram for gmx::InternalError:
+ Collaboration diagram for gmx::InternalError:

Description

Exception class for internal errors.

Public Member Functions

 InternalError (const ExceptionInitializer &details)
 Creates an exception object with the provided initializer/reason. More...
 
virtual int errorCode () const
 Returns the error code corresponding to the exception type.
 
virtual const char * what () const throw ()
 Returns the reason string for the exception. More...
 
void prependContext (const std::string &context)
 Adds context information to this exception. More...
 

Constructor & Destructor Documentation

gmx::InternalError::InternalError ( const ExceptionInitializer details)
inlineexplicit

Creates an exception object with the provided initializer/reason.

Parameters
[in]detailsInitializer for the exception.
Exceptions
std::bad_allocif out of memory.

It is possible to call this constructor either with an explicit ExceptionInitializer object (useful for more complex cases), or a simple string if only a reason string needs to be provided.

Member Function Documentation

void gmx::GromacsException::prependContext ( const std::string &  context)
inherited

Adds context information to this exception.

Parameters
[in]contextContext string to add.
Exceptions
std::bad_allocif out of memory.

Typical use is to add additional information higher up in the call stack using this function in a catch block and the rethrow the exception.

Todo:
The added information is currently not accessible through what(), nor through any other means except for calling printFatalErrorMessage(), formatExceptionMessageToString() or formatExceptionMessageToFile(). See ExceptionInitializer for more discussion.
const char * gmx::GromacsException::what ( ) const
throw (
)
virtualinherited

Returns the reason string for the exception.

The return value is the string that was passed to the constructor.


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