NAWA 0.9
Web Application Framework for C++
nawa::Exception Class Reference

#include <nawa/Exception.h>

Inherits std::exception.

Public Member Functions

 Exception (const std::string &inFunction, int errorCode, const std::string &message="No message provided.", const std::string &additionalDebugInfo=std::string())
 
virtual int getErrorCode () const noexcept
 
virtual std::string getMessage () const noexcept
 
virtual std::string getDebugMessage () const noexcept
 
char const * what () const noexcept override
 

Detailed Description

Exception class that can be used by apps to catch errors resulting from NAWA function calls.

Definition at line 35 of file Exception.h.

Constructor & Destructor Documentation

◆ Exception()

nawa::Exception::Exception ( const std::string &  inFunction,
int  errorCode,
const std::string &  message = "No message provided.",
const std::string &  additionalDebugInfo = std::string() 
)
inline

Construct an Exception with an additional message.

Parameters
inFunctionFunction in which the exception occurred.
errorCodeAn integral error code identifying the error that caused this exception.
messageOptional message describing the problem (the only thing printed when calling getMessage()).
additionalDebugInfoOptional additional info for debugging.

Definition at line 47 of file Exception.h.

Member Function Documentation

◆ getErrorCode()

virtual int nawa::Exception::getErrorCode ( ) const
inlinevirtualnoexcept

Get the integral error code that identifies the error that caused this exception.

Returns
The error code.

Definition at line 63 of file Exception.h.

◆ getMessage()

virtual std::string nawa::Exception::getMessage ( ) const
inlinevirtualnoexcept

Get the provided message as a string.

Returns
The provided message.

Definition at line 71 of file Exception.h.

◆ getDebugMessage()

virtual std::string nawa::Exception::getDebugMessage ( ) const
inlinevirtualnoexcept

Get the full constructed debug message as a string.

Returns

Definition at line 79 of file Exception.h.

◆ what()

char const * nawa::Exception::what ( ) const
inlineoverridenoexcept

Get the full constructed debug message. This function would be called and the message displayed when an uncaught Exception leads to termination. Use getMessage to get the message without debug information.

Returns
The full exception message.

Definition at line 88 of file Exception.h.


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