LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
|
Provides consistent interface for LSST exceptions. More...
#include <Exception.h>
Public Member Functions | |
Exception (char const *file, int line, char const *func, std::string const &message) | |
Standard constructor, intended for C++ use via the LSST_EXCEPT() macro. More... | |
Exception (std::string const &message) | |
Message-only constructor, intended for use from Python only. More... | |
virtual | ~Exception (void) noexcept |
void | 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). More... | |
Traceback const & | getTraceback (void) const noexcept |
Retrieve the list of tracepoints associated with an exception. More... | |
virtual std::ostream & | addToStream (std::ostream &stream) const |
Add a text representation of this exception, including its traceback with messages, to a stream. More... | |
virtual char const * | what (void) const noexcept |
Return a character string summarizing this exception. More... | |
virtual char const * | getType (void) const noexcept |
Return the fully-specified C++ type of a pointer to the exception. More... | |
virtual Exception * | clone (void) const |
Return a copy of the exception as an Exception pointer. More... | |
T | what (T... args) |
Provides consistent interface for LSST exceptions.
All exceptions defined by the LSST Stack are derived from this class. Code should not throw or catch Exception directly, but should instead be written in terms of the appropriate subclasses (e.g., catch RuntimeError to handle all unknown errors).
In Python, this exception inherits from builtins.Exception
.
Definition at line 107 of file Exception.h.
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.
[in] | file | Filename (automatically passed in by macro). |
[in] | line | Line number (automatically passed in by macro). |
[in] | func | Function name (automatically passed in by macro). |
[in] | message | Informational string attached to exception. |
Definition at line 42 of file Exception.cc.
|
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.
[in] | message | Informational string attached to exception. |
Definition at line 45 of file Exception.cc.
|
virtualnoexcept |
Definition at line 47 of file Exception.cc.
void 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).
[in] | file | Filename (automatically passed in by macro). |
[in] | line | Line number (automatically passed in by macro). |
[in] | func | Function name (automatically passed in by macro). |
[in] | message | Additional message to associate with this rethrow. |
Definition at line 49 of file Exception.cc.
|
virtual |
Add a text representation of this exception, including its traceback with messages, to a stream.
[in] | stream | Reference to an output stream. |
Definition at line 81 of file Exception.cc.
|
virtual |
Return a copy of the exception as an Exception pointer.
Can be overridden by derived classes that add data or methods.
Reimplemented in lsst::meas::base::MeasurementError.
Definition at line 103 of file Exception.cc.
|
noexcept |
Retrieve the list of tracepoints associated with an exception.
Definition at line 79 of file Exception.cc.
|
virtualnoexcept |
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 Python interface.
Reimplemented in lsst::meas::base::MeasurementError.
Definition at line 101 of file Exception.cc.
|
virtualnoexcept |
Return a character string summarizing this exception.
This combines all the 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.
Definition at line 99 of file Exception.cc.