25 #define __attribute__(x) 40 : _file(file), _line(line), _func(func), _message(message) {}
52 if (_traceback.
empty()) {
63 stream <<
"; " << message;
73 stream << message <<
" {" << _traceback.
size() <<
"}";
76 _message = stream.
str();
82 if (_traceback.
empty()) {
89 stream <<
" File \"" << _traceback[i]._file <<
"\", line " << _traceback[i]._line <<
", in " 91 stream <<
" " << _traceback[i]._message <<
" {" << i <<
"}" <<
std::endl;
94 stream << type <<
": '" << _message <<
"'" <<
std::endl;
virtual ~Exception(void) noexcept
virtual char const * getType(void) const noexcept
Return the fully-specified C++ type of a pointer to the exception.
Provides consistent interface for LSST exceptions.
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).
virtual char const * what(void) const noexcept
Return a character string summarizing this exception.
virtual std::ostream & addToStream(std::ostream &stream) const
Add a text representation of this exception, including its traceback with messages, to a stream.
A base class for image defects.
virtual Exception * clone(void) const
Return a copy of the exception as an Exception pointer.
Traceback const & getTraceback(void) const noexcept
Retrieve the list of tracepoints associated with an exception.
def line(points, frame=None, origin=afwImage.PARENT, symbs=False, ctype=None, size=0.5)
Tracepoint(char const *file, int line, char const *func, std::string const &message)
Standard constructor, intended for C++ use.
std::ostream & operator<<(std::ostream &stream, Exception const &e)
Push the text representation of an exception onto a stream.
Exception(char const *file, int line, char const *func, std::string const &message)
Standard constructor, intended for C++ use via the LSST_EXCEPT() macro.
One point in the Traceback vector held by Exception.