lsst.meas.base gd5020cc1fb+4664e4af1f
Loading...
Searching...
No Matches
Public Member Functions | List of all members
lsst::meas::base::MeasurementError Class Reference

Exception to be thrown when a measurement algorithm experiences a known failure mode. More...

#include <exceptions.h>

Inheritance diagram for lsst::meas::base::MeasurementError:
lsst::pex::exceptions::RuntimeError lsst::pex::exceptions::Exception std::exception

Public Member Functions

 MeasurementError (std::string const &message, std::size_t flagBit)
 Constructor; should only be invoked from Python macro. More...
 
 MeasurementError (LSST_EARGS_TYPED, std::size_t flagBit)
 Constructor; should only be invoked by the LSST_EXCEPT macro (see class docs) More...
 
std::size_t getFlagBit () const
 Return the flag bit associated with the error. More...
 
virtual char const * getType (void) const throw ()
 
virtual lsst::pex::exceptions::Exceptionclone (void) const
 
void addMessage (char const *file, int line, char const *func, std::string const &message)
 
Traceback const & getTraceback (void) const noexcept
 
virtual std::ostreamaddToStream (std::ostream &stream) const
 
virtual char const * what (void) const noexcept
 
what (T... args)
 

Detailed Description

Exception to be thrown when a measurement algorithm experiences a known failure mode.

In addition to the usual message, MeasurementError must be constructed with the bit of the algorithm-specific flag that indicates the known failure mode. This allows the measurement framework to set that flag upon failure. Typically, this flag bit is also used to look up the message from the algorithm classes FlagDefinition list; the common pattern is:

if (badThingHappened) {
// BAD_THING is an enum value from the Algorithm's FlagBits enum; getFlagDefinitions()
// is a static method algorithms are expected to define.
throw LSST_EXCEPT(MeasurementError, getFlagDefinitions()[BAD_THING), BAD_THING);
}
#define LSST_EXCEPT(type,...)
Exception to be thrown when a measurement algorithm experiences a known failure mode.
Definition: exceptions.h:48

Definition at line 48 of file exceptions.h.

Constructor & Destructor Documentation

◆ MeasurementError() [1/2]

lsst::meas::base::MeasurementError::MeasurementError ( std::string const &  message,
std::size_t  flagBit 
)
inline

Constructor; should only be invoked from Python macro.

Definition at line 51 of file exceptions.h.

◆ MeasurementError() [2/2]

lsst::meas::base::MeasurementError::MeasurementError ( LSST_EARGS_TYPED  ,
std::size_t  flagBit 
)
inline

Constructor; should only be invoked by the LSST_EXCEPT macro (see class docs)

Definition at line 55 of file exceptions.h.

Member Function Documentation

◆ clone()

virtual lsst::pex::exceptions::Exception * lsst::meas::base::MeasurementError::clone ( void  ) const
inlinevirtual

Reimplemented from lsst::pex::exceptions::RuntimeError.

Definition at line 63 of file exceptions.h.

◆ getFlagBit()

std::size_t lsst::meas::base::MeasurementError::getFlagBit ( ) const
inline

Return the flag bit associated with the error.

Definition at line 59 of file exceptions.h.

◆ getType()

virtual char const * lsst::meas::base::MeasurementError::getType ( void  ) const
throw (
)
inlinevirtual

Reimplemented from lsst::pex::exceptions::RuntimeError.

Definition at line 61 of file exceptions.h.


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