QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsError Class Reference

A container for error messages. More...

#include <qgserror.h>

Public Member Functions

 QgsError ()=default
 
 QgsError (const QString &message, const QString &tag)
 Constructor with single message.
 
void append (const QgsErrorMessage &message)
 Append new error message.
 
void append (const QString &message, const QString &tag)
 Append new error message.
 
void clear ()
 Clear error messages.
 
bool isEmpty () const
 Test if any error is set.
 
QString message (QgsErrorMessage::Format format=QgsErrorMessage::Html) const
 Full error messages description.
 
QList< QgsErrorMessagemessageList () const
 messageList return the list of current error messages
 
QString summary () const
 Short error description, usually the first error in chain, the real error.
 

Detailed Description

A container for error messages.

It may contain a chain (e.g. a traceback) of error messages (e.g. GDAL - provider - layer). Higher level messages are appended at the end.

Definition at line 80 of file qgserror.h.

Constructor & Destructor Documentation

◆ QgsError() [1/2]

QgsError::QgsError ( )
default

◆ QgsError() [2/2]

QgsError::QgsError ( const QString &  message,
const QString &  tag 
)

Constructor with single message.

Parameters
messageerror message
tagshort description, e.g. GDAL, Provider, Layer

Definition at line 34 of file qgserror.cpp.

Member Function Documentation

◆ append() [1/2]

void QgsError::append ( const QgsErrorMessage message)

Append new error message.

Parameters
messageerror message

Definition at line 44 of file qgserror.cpp.

◆ append() [2/2]

void QgsError::append ( const QString &  message,
const QString &  tag 
)

Append new error message.

Parameters
messageerror message string
tagerror label, for example GDAL, GDAL Provider, Raster layer

Definition at line 39 of file qgserror.cpp.

◆ clear()

void QgsError::clear ( )
inline

Clear error messages.

Definition at line 126 of file qgserror.h.

◆ isEmpty()

bool QgsError::isEmpty ( ) const
inline

Test if any error is set.

Returns
true if contains error

Definition at line 110 of file qgserror.h.

◆ message()

QString QgsError::message ( QgsErrorMessage::Format  format = QgsErrorMessage::Html) const

Full error messages description.

Parameters
formatoutput format
Returns
error report

Definition at line 49 of file qgserror.cpp.

◆ messageList()

QList< QgsErrorMessage > QgsError::messageList ( ) const
inline

messageList return the list of current error messages

Returns
current list of error messages

Definition at line 132 of file qgserror.h.

◆ summary()

QString QgsError::summary ( ) const

Short error description, usually the first error in chain, the real error.

Returns
error description

Definition at line 129 of file qgserror.cpp.


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