Medical Imaging Interaction Toolkit
2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
|
Go to the source code of this file.
Macros | |
#define | mitkThrow() |
#define | mitkReThrow(mitkexception) |
#define | mitkThrowException(classname) |
#define | mitkExceptionClassMacro(ClassName, SuperClassName) |
#define mitkExceptionClassMacro | ( | ClassName, | |
SuperClassName | |||
) |
Class macro for MITK exception classes. All MITK exception classes should derive from MITK::Exception.
Definition at line 62 of file mitkExceptionMacro.h.
#define mitkReThrow | ( | mitkexception | ) |
The rethrow macro is used to rethrow an existing exception. The rethrow information (file,line of code) is then additionally stored in the exception. To check if an exception was rethrown you can use the methods GetNumberOfRethrows() and GetRethrowData().
Example usage: try { //some code that throws an exception } catch(mitk::Exception e) { //here we want to rethrow the exception mitkReThrow(e) << "Message that will be appended to the exception (optional)"; }
Definition at line 45 of file mitkExceptionMacro.h.
#define mitkThrow | ( | ) |
The exception macro is used to throw an exception (i.e., usually a condition that results in program failure).
Example usage looks like: mitkThrow() << "this is error info";
Definition at line 27 of file mitkExceptionMacro.h.
#define mitkThrowException | ( | classname | ) |
The specialized exception macro is used to throw exceptions in cases of specialized errors. This means the second parameter must be a class which inherits from mitk::Exception. An object of this exception is thrown when using the macro. Thus, more differentiated excaptions can be thrown, when needed.
Example usage: mitkSpecializedExceptionMacro(mitk::MySpecializedException) << "this is error info";
Definition at line 57 of file mitkExceptionMacro.h.