TwiceAsNice  2019-02-18
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
Nice::Exception Class Reference


Helper Class and Makros for throwing exceptions with a exception stack. More...

#include <Exception.h>

Inherits std::exception, and std::exception.

Inherited by Basda::DevException, Basda::DevException, Basda::dmException, Basda::IceMemoryLimitException, Basda::IceMemoryLimitException, Basda::ImageException, Basda::ImageException, Basda::ImageException, Basda::Microgate::MgpException, Basda::Microgate::MgpException, Basda::Microgate::MgpException, Basda::MoccaException, Basda::MoccaException, Basda::ServiceException, Basda::ServiceException, Basda::VinoDeviceException, Basda::VinoDeviceException, Basda::VinoDeviceException, checkConnectionTimeout.ERR_TIMEOUT_OUT_OF_RANGE, checkConnectionTimeout.ERR_TIMEOUT_OUT_OF_RANGE, flashMoConParams.ERR_SETTINGS_NOT_DEFINED, flashMoConParams.ERR_SETTINGS_NOT_DEFINED, Flexure_Compensation.Error, gws_alignment.Error, HelperException1, HelperException1, HelperException2, HelperException2, initStages.InitError, initStages.InitError, initStages.InitError, Laos.Aoc.RecMatImpl.Error, Laos::Xinetics::Exception, Laos::Xinetics::Exception, Laos::Xinetics::Exception, Laos::Xinetics::ServiceException, Laos::Xinetics::ServiceException, LaosAocGWSRecMatServiceWorking.Error, LaosAocGWSRecMatServiceWorking.Error, LaosAocRecMatService.Error, LaosAocRecMatService.Error, LaosAocRecMatService_15006_berwein.Error, LaosGWSRecMatPythonServiceWorker.Error, LaosHWSRecMatPythonServiceWorker.Error, laospy.acquisition.ERR_CENTER_NOT_FOUND, laospy.acquisition.ERR_CENTER_NOT_FOUND, laospy.acquisition.ERR_NO_LIGHT_FOUND, laospy.acquisition.ERR_NO_LIGHT_FOUND, laospy.acquisition.ERR_PROPERTY_NOT_FOUND, laospy.acquisition.ERR_PROPERTY_NOT_FOUND, laospy.acquisition.ERR_SERVICE_NOT_FOUND, laospy.acquisition.ERR_SERVICE_NOT_FOUND, laospy.bcu.Error, laospy.bcu.Error, laospy.camera.Error, laospy.camera.Error, laospy.influence.Error, laospy.influence.Error, laospy.interaction.Error, laospy.interaction.Error, laospy.metapupil.Error, laospy.metapupil.Error, laospy.metapupil_I9.Error, laospy.metapupil_I9.Error, laospy.wfc.Error, laospy.wfc.Error, ln_depricated.laos.aoc.laospy.acquisition.ERR_CENTER_NOT_FOUND, ln_depricated.laos.aoc.laospy.acquisition.ERR_NO_LIGHT_FOUND, ln_depricated.laos.aoc.laospy.acquisition.ERR_PROPERTY_NOT_FOUND, ln_depricated.laos.aoc.laospy.acquisition.ERR_SERVICE_NOT_FOUND, ln_depricated.laos.aoc.laospy.camera.Error, ln_depricated.laos.aoc.laospy.influence.Error, ln_depricated.laos.aoc.laospy.interaction.Error, ln_depricated.laos.aoc.laospy.metapupil.Error, ln_depricated.laos.aoc.laospy.wfc.Error, ln_depricated.laos.aoc.service.rec_mat.LaosAocRecMatService.Error, ln_depricated.laos.aoc.service.rec_mat.LaosGWSRecMatPythonServiceWorker.Error, ln_depricated.laos.aoc.service.rec_mat.LaosHWSRecMatPythonServiceWorker.Error, moConParamsBase.ERR_MODULE_NOT_DEFINED, moConParamsBase.ERR_MODULE_NOT_DEFINED, moConParamsBase.ERR_MODULE_NOT_RESERVED, moConParamsBase.ERR_MODULE_NOT_RESERVED, moConParamsBase.ERR_MODULE_RESERVED, moConParamsBase.ERR_MODULE_RESERVED, Nice::AlgException, Nice::AlgException, Nice::AttributeNotFoundException, Nice::AttributeNotFoundException, Nice::BitSetException, Nice::BitSetException, Nice::ChatException, Nice::ChatException, Nice::PropertyException, Nice::PropertyException, Nice::PythonException, Nice::PythonException, Nice::PythonException, Nice::RandomException, Nice::RandomException, Nice::ReadWaitProxyException, Nice::ReadWaitProxyException, Nice::UnknownException, Nice::UnknownException, RecMatImpl.Error, Test::MyException1, and Test::MyException2.

Collaboration diagram for Nice::Exception:
Collaboration graph

Public Member Functions

virtual std::string toString () const
 
 Exception ()
 
 Exception (const Nice::SeqLoggerObject &_ex)
 
 operator Nice::SeqLoggerObject ()
 
const Nice::SeqLoggerObjectlog () const
 
virtual const char * what () const throw ()
 
void addLoggerObject (const Nice::LoggerObject &_err)
 
void addLoggerObject (const Nice::SeqLoggerObject &_serr)
 
virtual ~Exception () throw ()
 
virtual std::string toString () const
 
 Exception ()
 
 Exception (const Nice::SeqLoggerObject &_ex)
 
 operator Nice::SeqLoggerObject ()
 
const Nice::SeqLoggerObjectlog () const
 
virtual const char * what () const throw ()
 
void addLoggerObject (const Nice::LoggerObject &_err)
 
void addLoggerObject (const Nice::SeqLoggerObject &_serr)
 
virtual ~Exception () throw ()
 

Static Public Member Functions

static void raise (const std::string &_exceptStr, const Nice::SeqLoggerObject &_ex=Nice::SeqLoggerObject())
 
template<typename Type >
static void addException (const std::string &_exceptStr)
 
static void raise (const std::string &_exceptStr, const Nice::SeqLoggerObject &_ex=Nice::SeqLoggerObject())
 
template<typename Type >
static void addException (const std::string &_exceptStr)
 

Private Attributes

Nice::SeqLoggerObject m_stack
 

Static Private Attributes

static std::map< std::string, ExceptionRaiser * > s_exceptions
 

Friends

std::ostream & operator<< (std::ostream &, const Exception &)
 
template<class T >
createException (Nice::LEVEL, const char *, int, const char *, const std::string &)
 
template<class T >
createException (Nice::LEVEL, const char *, int, const char *, const std::string &, const Nice::Exception &)
 
template<class T >
createException (Nice::LEVEL, const char *, int, const char *, const std::string &, const Nice::SeqLoggerObject &)
 
std::ostream & operator<< (std::ostream &, const Exception &)
 
template<class T >
createException (Nice::LEVEL, const char *, int, const char *, const std::string &)
 
template<class T >
createException (Nice::LEVEL, const char *, int, const char *, const std::string &, const Nice::Exception &)
 
template<class T >
createException (Nice::LEVEL, const char *, int, const char *, const std::string &, const Nice::SeqLoggerObject &)
 

Detailed Description


Helper Class and Makros for throwing exceptions with a exception stack.

Author
Florian Briegel
Version
11.02.04
Date
2012-08-10 11:04:58 AM Exceptions can be used local and as an ICE exception. Now for a small example:
try
{
  try
  {
      try
      {
            E_THROW("Just error message");
      }

      catch(const Nice::Exception & e)
      {

          E_THROW(Exception, e, "Another error message");
      }
  }

  catch(const Nice::Exception & e)
  {
      E_THROW(Exception, e, "More error message" );
  }
}

catch(const Nice::SeqLoggerObject & e)
{
  E_LOG(e); // now dump the exceptions to the logging system.
}

You can derive your own exception class from Exception in an header file.

struct NodeNotFound : Nice::Exception
{

};
Todo:
Author
Florian Briegel
Version
11.02.04
Date
2012-08-10 11:04:58 AM Exceptions can be used local and as an ICE exception. Now for a small example:
try
{
  try
  {
      try
      {
            E_THROW("Just error message");
      }

      catch(const Nice::Exception & e)
      {

          E_THROW(Exception, e, "Another error message");
      }
  }

  catch(const Nice::Exception & e)
  {
      E_THROW(Exception, e, "More error message" );
  }
}

catch(const Nice::SeqLoggerObject & e)
{
  E_LOG(e); // now dump the exceptions to the logging system.
}

You can derive your own exception class from Exception in an header file.

struct NodeNotFound : Nice::Exception
{

};
Todo:

Constructor & Destructor Documentation

◆ Exception() [1/4]

Nice::Exception::Exception ( )
inline

◆ Exception() [2/4]

Nice::Exception::Exception ( const Nice::SeqLoggerObject _ex)
inline

◆ ~Exception() [1/2]

virtual Nice::Exception::~Exception ( )
throw (
)
inlinevirtual

◆ Exception() [3/4]

Nice::Exception::Exception ( )
inline

◆ Exception() [4/4]

Nice::Exception::Exception ( const Nice::SeqLoggerObject _ex)
inline

◆ ~Exception() [2/2]

virtual Nice::Exception::~Exception ( )
throw (
)
inlinevirtual

Member Function Documentation

◆ addException() [1/2]

template<typename Type >
static void Nice::Exception::addException ( const std::string &  _exceptStr)
inlinestatic

◆ addException() [2/2]

template<typename Type >
static void Nice::Exception::addException ( const std::string &  _exceptStr)
inlinestatic

◆ addLoggerObject() [1/4]

void Nice::Exception::addLoggerObject ( const Nice::LoggerObject _err)
inline

◆ addLoggerObject() [2/4]

void Nice::Exception::addLoggerObject ( const Nice::LoggerObject _err)
inline

◆ addLoggerObject() [3/4]

void Nice::Exception::addLoggerObject ( const Nice::SeqLoggerObject _serr)
inline

◆ addLoggerObject() [4/4]

void Nice::Exception::addLoggerObject ( const Nice::SeqLoggerObject _serr)
inline

◆ log() [1/2]

const Nice::SeqLoggerObject& Nice::Exception::log ( ) const
inline

◆ log() [2/2]

const Nice::SeqLoggerObject& Nice::Exception::log ( ) const
inline

◆ operator Nice::SeqLoggerObject() [1/2]

Nice::Exception::operator Nice::SeqLoggerObject ( )
inline

◆ operator Nice::SeqLoggerObject() [2/2]

Nice::Exception::operator Nice::SeqLoggerObject ( )
inline

◆ raise() [1/2]

static void Nice::Exception::raise ( const std::string &  _exceptStr,
const Nice::SeqLoggerObject _ex = Nice::SeqLoggerObject() 
)
static

◆ raise() [2/2]

void Exception::raise ( const std::string &  _exceptStr,
const Nice::SeqLoggerObject _ex = Nice::SeqLoggerObject() 
)
static

◆ toString() [1/2]

virtual std::string Nice::Exception::toString ( ) const
inlinevirtual

Reimplemented in Basda::Svc::MoccaNamedIntensityNotKnownException, Basda::Svc::MoccaNamedIntensityNotKnownException, Basda::Svc::MoccaNamedIntensityNotKnownException, Basda::Svc::MoccaLightSourceNotKnownException, Nice::UnknownException, Basda::Svc::MoccaLightSourceNotKnownException, Basda::Svc::MoccaLightSourceNotKnownException, Nice::UnknownException, Basda::Svc::MoccaProfileException, Basda::Svc::MoccaProfileException, Basda::Svc::MoccaProfileException, Basda::Svc::MoccaWheelReferenceSwitchNotFoundException, Basda::Svc::MoccaWheelReferenceSwitchNotFoundException, Basda::Svc::MoccaWheelReferenceSwitchNotFoundException, Laos::Svc::SEPythonException, Test::MyException2, Test::MyException1, Basda::Svc::MoccaWheelHomeSwitchNotFoundException, Basda::Svc::MoccaWheelHomeSwitchNotFoundException, Basda::Svc::MoccaWheelHomeSwitchNotFoundException, Laos::Svc::SESilhouetteException, Basda::ServiceAbortedException, Basda::ServiceAbortedException, Basda::Svc::MoccaWheelServiceException, Basda::Svc::MoccaWheelServiceException, Basda::Svc::MoccaWheelServiceException, Laos::Svc::SECollisionException, Basda::ServiceIsBusyException, Basda::ServiceIsBusyException, Basda::Svc::MoccaTransformationNotInvertableException, Basda::Svc::MoccaTransformationNotInvertableException, Basda::Svc::MoccaTransformationNotInvertableException, Laos::Svc::SELimitSwitchException, Basda::ServiceIsNotOnlineException, Basda::ServiceIsNotOnlineException, Basda::Svc::MoccaUnitNotKnownException, Basda::Svc::MoccaUnitNotKnownException, Basda::Svc::MoccaUnitNotKnownException, Laos::Svc::SEMotionException, Basda::ServiceErrorException, Basda::ServiceErrorException, Basda::Svc::MoccaCommandNotSupportedException, Basda::Svc::MoccaCommandNotSupportedException, Basda::Svc::MoccaCommandNotSupportedException, Basda::ServiceInterfaceUnsynchronizedException, Basda::ServiceInterfaceUnsynchronizedException, Laos::Svc::SEHomeModuleException, Basda::Svc::MoccaMotionException, Basda::Svc::MoccaMotionException, Basda::Svc::MoccaMotionException, Laos::Svc::SENotKnownException, Basda::ServiceInterfaceTerminatedException, Basda::ServiceInterfaceTerminatedException, Basda::ServiceException, Basda::Svc::MoccaServiceException, Basda::ServiceException, Basda::Svc::MoccaServiceException, Basda::Svc::MoccaServiceException, Laos::Svc::SEUnitNotKnownException, Basda::ServiceInterfaceCommandIsStillRunningException, Basda::ServiceInterfaceCommandIsStillRunningException, Laos::Svc::SEOutOfRangeException, Basda::IceMemoryLimitException, Basda::IceMemoryLimitException, Basda::ServiceInterfaceException, Basda::ServiceInterfaceException, Laos::Svc::SEWrongProfileException, Laos::SEDifferentDefaultCoordSys, Laos::SEDifferentDefaultCoordSys, Laos::SEDifferentDefaultUnits, Laos::SEDifferentDefaultUnits, Basda::DevException, Laos::SETransInconsistency, Laos::SETransInconsistency, Basda::DevException, Laos::SEWrongIDException, Laos::SEWrongIDException, Laos::SEPythonException, Laos::SEPythonException, Laos::SESilhouetteException, Laos::SESilhouetteException, Laos::DrotCommandExecutionFailedException, Laos::SECollisionException, Laos::DrotCommandExecutionFailedException, Laos::Svc::SEServiceException, Laos::SECollisionException, Laos::DrotPolynomialToShortException, Laos::SELimitSwitchException, Laos::DrotPolynomialToShortException, Laos::SELimitSwitchException, Laos::DrotPythonException, Laos::SEMotionException, Laos::DrotPythonException, Laos::SEMotionException, Laos::DrotLimitSwitchException, Laos::SEHomeModuleException, Laos::DrotLimitSwitchException, Laos::SEHomeModuleException, HelperException2, HelperException2, Laos::DrotMotionException, Laos::SENotKnownException, Laos::DrotMotionException, Laos::SENotKnownException, Laos::DrotHomeException, Laos::SEUnitNotKnownException, Laos::DrotHomeException, Laos::SEUnitNotKnownException, Basda::VinoCameraCtrlConnectionError, Laos::DrotUnitNotKnownException, Laos::SEOutOfRangeException, Laos::DrotUnitNotKnownException, Laos::SEOutOfRangeException, Basda::VinoCameraCtrlConnectionError, Basda::VinoCameraCtrlIsIdle, Laos::DrotOutOfRangeException, Laos::SEWrongProfileException, Laos::DrotOutOfRangeException, Laos::SEWrongProfileException, Basda::SimpleFatal, Basda::VinoCameraCtrlIsIdle, Basda::VinoCameraCtrlRingBufferError, Laos::DrotWrongProfileException, Laos::SEServiceException, Ltcs::RotatorPolynomialException, Laos::DrotWrongProfileException, Laos::SEServiceException, Ltcs::RotatorPolynomialException, Basda::SimpleError2, Basda::VinoCameraCtrlRingBufferError, HelperException1, HelperException1, Basda::VinoCameraCtrlError, Laos::DrotServiceException, Laos::ServiceException, Ltcs::IIFServiceException, Laos::DrotServiceException, Laos::ServiceException, Laos::ServiceException, Ltcs::IIFServiceException, Basda::SimpleError1, Basda::VinoCameraCtrlError, Nice::PythonException, Nice::PythonException, and Nice::PythonException.

◆ toString() [2/2]

virtual std::string Nice::Exception::toString ( ) const
inlinevirtual

Reimplemented in Basda::Svc::MoccaNamedIntensityNotKnownException, Basda::Svc::MoccaNamedIntensityNotKnownException, Basda::Svc::MoccaNamedIntensityNotKnownException, Basda::Svc::MoccaLightSourceNotKnownException, Nice::UnknownException, Basda::Svc::MoccaLightSourceNotKnownException, Basda::Svc::MoccaLightSourceNotKnownException, Nice::UnknownException, Basda::Svc::MoccaProfileException, Basda::Svc::MoccaProfileException, Basda::Svc::MoccaProfileException, Basda::Svc::MoccaWheelReferenceSwitchNotFoundException, Basda::Svc::MoccaWheelReferenceSwitchNotFoundException, Basda::Svc::MoccaWheelReferenceSwitchNotFoundException, Laos::Svc::SEPythonException, Test::MyException2, Test::MyException1, Basda::Svc::MoccaWheelHomeSwitchNotFoundException, Basda::Svc::MoccaWheelHomeSwitchNotFoundException, Basda::Svc::MoccaWheelHomeSwitchNotFoundException, Laos::Svc::SESilhouetteException, Basda::ServiceAbortedException, Basda::ServiceAbortedException, Basda::Svc::MoccaWheelServiceException, Basda::Svc::MoccaWheelServiceException, Basda::Svc::MoccaWheelServiceException, Laos::Svc::SECollisionException, Basda::ServiceIsBusyException, Basda::ServiceIsBusyException, Basda::Svc::MoccaTransformationNotInvertableException, Basda::Svc::MoccaTransformationNotInvertableException, Basda::Svc::MoccaTransformationNotInvertableException, Laos::Svc::SELimitSwitchException, Basda::ServiceIsNotOnlineException, Basda::ServiceIsNotOnlineException, Basda::Svc::MoccaUnitNotKnownException, Basda::Svc::MoccaUnitNotKnownException, Basda::Svc::MoccaUnitNotKnownException, Laos::Svc::SEMotionException, Basda::ServiceErrorException, Basda::ServiceErrorException, Basda::Svc::MoccaCommandNotSupportedException, Basda::Svc::MoccaCommandNotSupportedException, Basda::Svc::MoccaCommandNotSupportedException, Basda::ServiceInterfaceUnsynchronizedException, Basda::ServiceInterfaceUnsynchronizedException, Laos::Svc::SEHomeModuleException, Basda::Svc::MoccaMotionException, Basda::Svc::MoccaMotionException, Basda::Svc::MoccaMotionException, Laos::Svc::SENotKnownException, Basda::ServiceInterfaceTerminatedException, Basda::ServiceInterfaceTerminatedException, Basda::ServiceException, Basda::Svc::MoccaServiceException, Basda::ServiceException, Basda::Svc::MoccaServiceException, Basda::Svc::MoccaServiceException, Laos::Svc::SEUnitNotKnownException, Basda::ServiceInterfaceCommandIsStillRunningException, Basda::ServiceInterfaceCommandIsStillRunningException, Laos::Svc::SEOutOfRangeException, Basda::IceMemoryLimitException, Basda::IceMemoryLimitException, Basda::ServiceInterfaceException, Basda::ServiceInterfaceException, Laos::Svc::SEWrongProfileException, Laos::SEDifferentDefaultCoordSys, Laos::SEDifferentDefaultCoordSys, Laos::SEDifferentDefaultUnits, Laos::SEDifferentDefaultUnits, Basda::DevException, Laos::SETransInconsistency, Laos::SETransInconsistency, Basda::DevException, Laos::SEWrongIDException, Laos::SEWrongIDException, Laos::SEPythonException, Laos::SEPythonException, Laos::SESilhouetteException, Laos::SESilhouetteException, Laos::DrotCommandExecutionFailedException, Laos::SECollisionException, Laos::DrotCommandExecutionFailedException, Laos::Svc::SEServiceException, Laos::SECollisionException, Laos::DrotPolynomialToShortException, Laos::SELimitSwitchException, Laos::DrotPolynomialToShortException, Laos::SELimitSwitchException, Laos::DrotPythonException, Laos::SEMotionException, Laos::DrotPythonException, Laos::SEMotionException, Laos::DrotLimitSwitchException, Laos::SEHomeModuleException, Laos::DrotLimitSwitchException, Laos::SEHomeModuleException, HelperException2, HelperException2, Laos::DrotMotionException, Laos::SENotKnownException, Laos::DrotMotionException, Laos::SENotKnownException, Laos::DrotHomeException, Laos::SEUnitNotKnownException, Laos::DrotHomeException, Laos::SEUnitNotKnownException, Basda::VinoCameraCtrlConnectionError, Laos::DrotUnitNotKnownException, Laos::SEOutOfRangeException, Laos::DrotUnitNotKnownException, Laos::SEOutOfRangeException, Basda::VinoCameraCtrlConnectionError, Basda::VinoCameraCtrlIsIdle, Laos::DrotOutOfRangeException, Laos::SEWrongProfileException, Laos::DrotOutOfRangeException, Laos::SEWrongProfileException, Basda::SimpleFatal, Basda::VinoCameraCtrlIsIdle, Basda::VinoCameraCtrlRingBufferError, Laos::DrotWrongProfileException, Laos::SEServiceException, Ltcs::RotatorPolynomialException, Laos::DrotWrongProfileException, Laos::SEServiceException, Ltcs::RotatorPolynomialException, Basda::SimpleError2, Basda::VinoCameraCtrlRingBufferError, HelperException1, HelperException1, Basda::VinoCameraCtrlError, Laos::DrotServiceException, Laos::ServiceException, Ltcs::IIFServiceException, Laos::DrotServiceException, Laos::ServiceException, Laos::ServiceException, Ltcs::IIFServiceException, Basda::SimpleError1, Basda::VinoCameraCtrlError, Nice::PythonException, Nice::PythonException, and Nice::PythonException.

◆ what() [1/2]

const char * Exception::what ( ) const
throw (
)
virtual

◆ what() [2/2]

virtual const char* Nice::Exception::what ( ) const
throw (
)
virtual

Friends And Related Function Documentation

◆ createException [1/6]

template<class T >
T createException ( Nice::LEVEL  _type,
const char *  _file,
int  _line,
const char *  _func,
const std::string &  _log 
)
friend

◆ createException [2/6]

template<class T >
T createException ( Nice::LEVEL  _type,
const char *  _file,
int  _line,
const char *  _func,
const std::string &  _log 
)
friend

◆ createException [3/6]

template<class T >
T createException ( Nice::LEVEL  _type,
const char *  _file,
int  _line,
const char *  _func,
const std::string &  _log,
const Nice::Exception _ex 
)
friend

◆ createException [4/6]

template<class T >
T createException ( Nice::LEVEL  _type,
const char *  _file,
int  _line,
const char *  _func,
const std::string &  _log,
const Nice::Exception _ex 
)
friend

◆ createException [5/6]

template<class T >
T createException ( Nice::LEVEL  _type,
const char *  _file,
int  _line,
const char *  _func,
const std::string &  _log,
const Nice::SeqLoggerObject _stack 
)
friend

◆ createException [6/6]

template<class T >
T createException ( Nice::LEVEL  _type,
const char *  _file,
int  _line,
const char *  _func,
const std::string &  _log,
const Nice::SeqLoggerObject _stack 
)
friend

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  ,
const Exception  
)
friend

◆ operator<< [2/2]

std::ostream& operator<< ( std::ostream &  ,
const Exception  
)
friend

Member Data Documentation

◆ m_stack

Nice::SeqLoggerObject Exception::m_stack
private

◆ s_exceptions

static std::map< std::string, ExceptionRaiser * > Exception::s_exceptions
staticprivate

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