KanoopCommonQt 2.1.1
Kanoop foundational Qt utility library
Loading...
Searching...
No Matches
CommonException Class Reference

CommonException. More...

#include <commonexception.h>

+ Inheritance diagram for CommonException:
+ Collaboration diagram for CommonException:

Public Member Functions

 CommonException (const QString &message, qint32 code=0)
 Construct a CommonException with a message and optional error code.
 
void raise () const override
 Re-throw this exception.
 
CommonExceptionclone () const override
 Create a heap-allocated copy of this exception.
 
virtual QString message () const
 Return the error message.
 
virtual qint32 code () const
 Return the numeric error code.
 

Detailed Description

CommonException.

A base class for Qt exceptions

Stephen Punak, September 17 2023

Base exception class for KanoopCommonQt, extending QException with a message and error code.

Definition at line 18 of file commonexception.h.

Constructor & Destructor Documentation

◆ CommonException()

CommonException::CommonException ( const QString &  message,
qint32  code = 0 
)

Construct a CommonException with a message and optional error code.

Parameters
messageHuman-readable description of the error
codeOptional numeric error code (default 0)

Member Function Documentation

◆ clone()

CommonException * CommonException::clone ( ) const
inlineoverride

Create a heap-allocated copy of this exception.

Returns
New CommonException allocated on the heap.

Definition at line 33 of file commonexception.h.

◆ code()

virtual qint32 CommonException::code ( ) const
inlinevirtual

Return the numeric error code.

Returns
Error code supplied at construction

Definition at line 45 of file commonexception.h.

◆ message()

virtual QString CommonException::message ( ) const
inlinevirtual

Return the error message.

Returns
Human-readable error description

Definition at line 39 of file commonexception.h.

◆ raise()

void CommonException::raise ( ) const
inlineoverride

Re-throw this exception.

Definition at line 29 of file commonexception.h.


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