Skip to content

GenericException ​

cpp
#include <utlib/include/utl/types/Exception.h>
cpp
template<typename T>
struct GenericException

Defined in utlib/include/utl/types/Exception.h:27

An exception that carries a payload and a message.

Public Attributes ​

ReturnNameDescription
TpayloadException-specific payload.
std::stringmsgMessage returned by what().

payload ​

cpp
T payload

Defined in utlib/include/utl/types/Exception.h:29

Exception-specific payload.


msg ​

cpp
std::string msg

Defined in utlib/include/utl/types/Exception.h:30

Message returned by what().

Public Methods ​

ReturnNameDescription
GenericException inline explicitCreates an exception with a payload and a message.
const char *what const inline noexcept overrideReturns the message.
voidset_msg inlineSetters.
voidset_payload inlineReplaces the payload.

GenericException ​

inline explicit

cpp
inline explicit GenericException(T payload = {}, std::string msg = "")

Defined in utlib/include/utl/types/Exception.h:33

Creates an exception with a payload and a message.


what ​

const inline noexcept override

cpp
inline const char * what() const noexcept override

Defined in utlib/include/utl/types/Exception.h:37

Returns the message.


set_msg ​

inline

cpp
inline void set_msg(std::string value)

Defined in utlib/include/utl/types/Exception.h:42

Setters.


set_payload ​

inline

cpp
inline void set_payload(T value)

Defined in utlib/include/utl/types/Exception.h:44

Replaces the payload.