lsst.pex.exceptions  8.0.0.0-23-g68b96ed
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines
Public Member Functions
lsst::pex::exceptions::Exception Class Reference

#include <Exception.h>

Inheritance diagram for lsst::pex::exceptions::Exception:
lsst::pex::exceptions::LogicError lsst::pex::exceptions::NotFoundError lsst::pex::exceptions::RuntimeError lsst::pex::exceptions::DomainError lsst::pex::exceptions::InvalidParameterError lsst::pex::exceptions::LengthError lsst::pex::exceptions::OutOfRangeError lsst::pex::exceptions::IoError lsst::pex::exceptions::MemoryError lsst::pex::exceptions::OverflowError lsst::pex::exceptions::RangeError lsst::pex::exceptions::TimeoutError lsst::pex::exceptions::TypeError lsst::pex::exceptions::UnderflowError

List of all members.

Public Member Functions

 Exception (char const *file, int line, char const *func, std::string const &message)
 Exception (std::string const &message)
virtual ~Exception (void) throw ()
void addMessage (char const *file, int line, char const *func, std::string const &message)
Traceback const & getTraceback (void) const throw ()
 Retrieve the list of tracepoints associated with an exception.
virtual std::ostream & addToStream (std::ostream &stream) const
virtual char const * what (void) const throw ()
virtual char const * getType (void) const throw ()
virtual Exceptionclone (void) const

Constructor & Destructor Documentation

lsst::pex::exceptions::Exception::Exception ( char const *  file,
int  line,
char const *  func,
std::string const &  message 
)

Standard constructor, intended for C++ use via the LSST_EXCEPT() macro.

Parameters:
[in]fileFilename (automatically passed in by macro).
[in]lineLine number (automatically passed in by macro).
[in]funcFunction name (automatically passed in by macro).
[in]messageInformational string attached to exception.

Referenced by clone().

lsst::pex::exceptions::Exception::Exception ( std::string const &  message) [explicit]

Message-only constructor, intended for use from Python only.

While this constructor can be called from C++, it's better to use the LSST_EXCEPT macro there, which stores file/line/function information as well. In Python, however, that information is stored outside the exception, so we don't want to duplicate it, and hence this constructor is invoked instead.

Parameters:
[in]messageInformational string attached to exception.
lsst::pex::exceptions::Exception::~Exception ( void  ) throw () [virtual]

Member Function Documentation

void lsst::pex::exceptions::Exception::addMessage ( char const *  file,
int  line,
char const *  func,
std::string const &  message 
)

Add a tracepoint and a message to an exception before rethrowing it (access via LSST_EXCEPT_ADD).

Parameters:
[in]fileFilename (automatically passed in by macro).
[in]lineLine number (automatically passed in by macro).
[in]funcFunction name (automatically passed in by macro).
[in]messageAdditional message to associate with this rethrow.
std::ostream & lsst::pex::exceptions::Exception::addToStream ( std::ostream &  stream) const [virtual]

Add a text representation of this exception, including its traceback with messages, to a stream.

Parameters:
[in]streamReference to an output stream.
Returns:
Reference to the output stream after adding the text.

References getType().

Referenced by lsst::pex::exceptions::operator<<().

Exception * lsst::pex::exceptions::Exception::clone ( void  ) const [virtual]

Return a copy of the exception as an Exception*. Can be overridden by derived classes that add data or methods.

Returns:
Exception* pointing to a copy of the exception.

References Exception().

Traceback const & lsst::pex::exceptions::Exception::getTraceback ( void  ) const throw ()

Retrieve the list of tracepoints associated with an exception.

char const * lsst::pex::exceptions::Exception::getType ( void  ) const throw () [virtual]

Return the fully-specified C++ type of a pointer to the exception. This is overridden by derived classes (automatically if the LSST_EXCEPTION_TYPE macro is used). It is used by the SWIG interface.

Returns:
String with the C++ type; does not need to be freed/deleted.

Referenced by addToStream().

char const * lsst::pex::exceptions::Exception::what ( void  ) const throw () [virtual]

Return a character string summarizing this exception.

This combines the all messages added to the exception, but not the type or traceback (use the stream operator to get this more detailed information).

Not allowed to throw any exceptions.

Returns:
String representation; does not need to be freed/deleted.

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines