OpenLexocad  27.1
Exception.h File Reference
#include <exception>
#include <string>

Go to the source code of this file.

Classes

class  Base::Exception
 
class  Base::AbortException
 
class  Base::MemoryException
 
class  Base::ConstructionError
 
class  Base::FailedNotDone
 
class  Base::ItemNotFound
 
class  Base::OutOfRange
 
class  Base::NotaNumber
 
class  Base::FileException
 
class  Base::VectorWithNullMagnitude
 
class  Base::BadArguments
 
class  Base::GuidInUseException
 
class  Base::RuntimeError
 
class  Base::ValueError
 
class  Base::CADKernelError
 
class  Base::TypeError
 
class  Base::NotImplementedError
 
class  Base::DivisionByZeroError
 

Namespaces

 Base
 

Macros

#define THROW(exception)
 
#define THROWM(exception, message)
 
#define THROWMF_FILEEXCEPTION(message, filenameorfileinfo)
 
#define THROWT(exception)
 
#define THROWMT(exception, message)
 
#define THROWMFT_FILEEXCEPTION(message, filenameorfileinfo)
 
#define FC_THROWM(_exception, _msg)
 
#define THROW_CON_ERR_IF(_condition_, _msg_)
 
#define THROW_FAIL_NDONE_IF(_condition_, _msg_)
 
#define OutOfRange_Raise_if(CONDITION, MESSAGE)
 
#define ConstructionError_Raise_if(CONDITION, MESSAGE)
 
#define VectorWithNullMagnitude_Raise_if(CONDITION, MESSAGE)
 
#define NotaNumber_if(CONDITION, MESSAGE)
 

Macro Definition Documentation

◆ ConstructionError_Raise_if

#define ConstructionError_Raise_if (   CONDITION,
  MESSAGE 
)
Value:
if (CONDITION) \
throw Base::ConstructionError(MESSAGE);
Definition: Exception.h:257

◆ FC_THROWM

#define FC_THROWM (   _exception,
  _msg 
)
Value:
do \
{ \
std::stringstream ss; \
ss << _msg; \
THROWM(_exception, ss.str().c_str()); \
} while (0)

◆ NotaNumber_if

#define NotaNumber_if (   CONDITION,
  MESSAGE 
)
Value:
if (CONDITION) \
throw Base::NotaNumber(MESSAGE);
Definition: Exception.h:329

◆ OutOfRange_Raise_if

#define OutOfRange_Raise_if (   CONDITION,
  MESSAGE 
)
Value:
if (CONDITION) \
throw Base::OutOfRange(MESSAGE);
Definition: Exception.h:311

◆ THROW

#define THROW (   exception)
Value:
{ \
exception myexcp; \
myexcp.setDebugInformation(__FILE__, __LINE__, __func__); \
throw myexcp; \
}

the macros do NOT mark any message for translation If you want to mark text for translation, use the QT_TRANSLATE_NOOP macro with the context "Exceptions" and the right throwing macro from below (the one ending in T) example: THROWMT(Base::ValueError,QT_TRANSLATE_NOOP("Exceptions","The multiplicity cannot be increased beyond the degree of the B-Spline."));

N.B.: The QT_TRANSLATE_NOOP macro won't translate your string. It will just allow lupdate to identify that string for translation so that if you ask for a translation (and the translator have provided one) at that time it gets translated (e.g. in the UI before showing the message of the exception).

◆ THROW_CON_ERR_IF

#define THROW_CON_ERR_IF (   _condition_,
  _msg_ 
)
Value:
if (_condition_) \
Definition: Exception.h:257

◆ THROW_FAIL_NDONE_IF

#define THROW_FAIL_NDONE_IF (   _condition_,
  _msg_ 
)
Value:
if (_condition_) \
throw Base::FailedNotDone(_msg_);
Definition: Exception.h:275

◆ THROWM

#define THROWM (   exception,
  message 
)
Value:
{ \
exception myexcp(message); \
myexcp.setDebugInformation(__FILE__, __LINE__, __func__); \
throw myexcp; \
}

◆ THROWMF_FILEEXCEPTION

#define THROWMF_FILEEXCEPTION (   message,
  filenameorfileinfo 
)
Value:
{ \
FileException myexcp(message, filenameorfileinfo); \
myexcp.setDebugInformation(__FILE__, __LINE__, __func__); \
throw myexcp; \
}

◆ THROWMFT_FILEEXCEPTION

#define THROWMFT_FILEEXCEPTION (   message,
  filenameorfileinfo 
)
Value:
{ \
FileException myexcp(message, filenameorfileinfo); \
myexcp.setDebugInformation(__FILE__, __LINE__, __func__); \
myexcp.setTranslatable(true); \
throw myexcp; \
}

◆ THROWMT

#define THROWMT (   exception,
  message 
)
Value:
{ \
exception myexcp(message); \
myexcp.setDebugInformation(__FILE__, __LINE__, __func__); \
myexcp.setTranslatable(true); \
throw myexcp; \
}

◆ THROWT

#define THROWT (   exception)
Value:
{ \
exception myexcp; \
myexcp.setDebugInformation(__FILE__, __LINE__, __func__); \
myexcp.setTranslatable(true); \
throw myexcp; \
}

◆ VectorWithNullMagnitude_Raise_if

#define VectorWithNullMagnitude_Raise_if (   CONDITION,
  MESSAGE 
)
Value:
if (CONDITION) \
Definition: Exception.h:365