Overview / Foundation

diagnostics

Warnings and errors formatted in <code>std::format</code> style, and a library exception class.

Always compiled: part of the core build.Include #include <ethereal/cpp/diagnostics/error_inc.hpp>C layer

error_inc.hpp

#include <ethereal/cpp/diagnostics/error_inc.hpp>
macro

ETL_WARNING

#
#define ETL_WARNING( sName, sDescription, ... ) \

Displays a warning in the user interface. Initially attempts to show the message in a separate routine (thread) to avoid blocking the main thread. If thread creation fails, the message will be displayed on the main thread, blocking the application. Generates a log entry in the log file (if enabled and configured).

@macro ETL_WARNING

sName
Name or identifier of the warning in C-string format.
sDescription
Warning description in C-string format with formatting arguments.
macro

ETL_ERROR

#
#define ETL_ERROR( sName, sDescription, ... ) \

Displays an error in the user interface. Initially attempts to show the message in a separate routine (thread) to avoid blocking the main thread. If thread creation fails, the message will be displayed on the main thread, blocking the application. Generates a log entry in the log file (if enabled and configured). Forces application termination by throwing an exception.

@macro ETL_ERROR

sName
Name or identifier of the error in C-string format.
sDescription
Error description in C-string format with formatting arguments.

error.hpp

#include <ethereal/cpp/diagnostics/error.hpp>
function

WarningHandler

Ethereal::Error#
template< typename... Args > void WarningHandler( const char * sWarningName, const char * sDescription, Args &&... args )
function

ErrorHandler

Ethereal::Error#
template< typename... Args > void ErrorHandler( const char * sErrorName, const char * sDescription, Args &&... args )

Generates an error. Displays the error message in the user interface. Use the @macro ETL_ERROR to access this functionality; it must never be accessed directly.

sErrorName
Name of the error.
sDescription
Description with std::format-style '{}' placeholders.
args
Values substituted into the placeholders.

exception.hpp

#include <ethereal/cpp/diagnostics/exception.hpp>
class

CException

Ethereal::Exception#

Exception helper class.

class CException : public std::exception

There is no guarantee that it is thread-safe. Synchronization is the responsibility of the caller. It must not be directly inherited by any structure, class, or object.

constructor

CException

#
explicit CException( const std::string & ExceptionDesc );

Default constructor.

function

what

#
const char * what( void ) const noexcept override;

Retrieves the exception description. Override of the original function, see std::exception.

C-string containing the exception description.
function

ForceApplicationException

Ethereal::Exception#
void ForceApplicationException( const char * Description = nullptr );