LuciadCPillar 2024.0.08
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
luciad::Exception Class Reference

Represents errors that occur during application execution. More...

#include <luciad/Exception.h>

Inheritance diagram for luciad::Exception:
luciad::IOException luciad::InvalidArgumentException luciad::LicenseException luciad::LogicException luciad::NotImplementedException luciad::ParseException luciad::RuntimeException luciad::NullArgumentException

Public Member Functions

 Exception (std::string message)
 Initializes a new instance of the Exception class with a specified error message. More...
 
 Exception (std::string message, const Exception &innerException)
 Initializes a new instance of the Exception class with a specified error message and a reference to the inner exception that is the cause of this exception. More...
 
virtual ~Exception ()
 
std::optional< ExceptiongetInnerException () const
 Returns the inner exception that caused this exception. More...
 
std::string getStackTrace () const
 Returns the string representation of the stack trace including all the inner exceptions stack traces. More...
 
std::string what () const
 Returns the message that describes the error. More...
 

Detailed Description

Represents errors that occur during application execution.

Remarks
This class is the base class for all exceptions with basic stack trace information (when compiled with debug information "RelWithDebInfo").

Constructor & Destructor Documentation

◆ Exception() [1/2]

luciad::Exception::Exception ( std::string  message)
explicit

Initializes a new instance of the Exception class with a specified error message.

Parameters
messagethe message that describes the error

◆ ~Exception()

virtual luciad::Exception::~Exception ( )
virtual

◆ Exception() [2/2]

luciad::Exception::Exception ( std::string  message,
const Exception innerException 
)

Initializes a new instance of the Exception class with a specified error message and a reference to the inner exception that is the cause of this exception.

Parameters
messagethe message that describes the error.
innerExceptionthe inner exception that caused this exception.

Member Function Documentation

◆ getInnerException()

std::optional< Exception > luciad::Exception::getInnerException ( ) const

Returns the inner exception that caused this exception.

Returns
the inner exception that caused this exception.

◆ getStackTrace()

std::string luciad::Exception::getStackTrace ( ) const

Returns the string representation of the stack trace including all the inner exceptions stack traces.

Remarks
Basic stack trace information is only available if compiled with debug information e.g in debug mode or in RelWithDebInfo. Retrieving stack trace information is a very slow operation especially in Windows OS.
Returns
the string representation of the stack trace including all the inner exceptions stack traces.

◆ what()

std::string luciad::Exception::what ( ) const

Returns the message that describes the error.

Returns
the message that describes the error.