ChimeraTK-DeviceAccess  03.18.00
ChimeraTK::logic_error Class Reference

Exception thrown when a logic error has occured. More...

#include <Exception.h>

+ Inheritance diagram for ChimeraTK::logic_error:
+ Collaboration diagram for ChimeraTK::logic_error:

Public Member Functions

 logic_error (std::string message) noexcept
 Constructor. More...
 
const char * what () const noexcept override
 Return the message describing what exactly went wrong. More...
 

Detailed Description

Exception thrown when a logic error has occured.

This usually means that the program logic is flawed, which points to a programming or configuration error. The exception is also thrown if a feature is used which is not implemented (e.g. an unsupported AccessModeFlag has been specified). After the exception, the system might be in an unspecified condition which might require shutting down the application.

Note, that it should be generally possible to avoid thrown logic_error exceptions in the first place by checking the system status and only perfoming only allowed operations. Therefore it is good practice to not catch this type of exceptions in applications, or to catch the error only for proper dispaly in a GUI and then terminate.

Definition at line 51 of file Exception.h.

Constructor & Destructor Documentation

◆ logic_error()

ChimeraTK::logic_error::logic_error ( std::string  message)
explicitnoexcept

Constructor.

The passed message is returned by a call to what() and should describe what exactly went wront.

Definition at line 18 of file Exception.cpp.

Member Function Documentation

◆ what()

const char * ChimeraTK::logic_error::what ( ) const
overridenoexcept

Return the message describing what exactly went wrong.

The returned message is only descriptive and only meant for display. Program logic must never be based on the content of this string.

Definition at line 20 of file Exception.cpp.

+ Here is the caller graph for this function:

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