Class MeasurementError

Inheritance Relationships

Base Type

  • public RuntimeError

Class Documentation

class MeasurementError : public RuntimeError

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);
 }

Public Functions

MeasurementError(std::string const &message, std::size_t flagBit)

Constructor; should only be invoked from Python macro.

MeasurementError(LSST_EARGS_TYPED, std::size_t flagBit)

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

std::size_t getFlagBit() const

Return the flag bit associated with the error.

virtual char const *getType(void) const
virtual lsst::pex::exceptions::Exception *clone(void) const