QGIS API Documentation  3.24.2-Tisler (13c1a02865)
Public Member Functions | List of all members
QgsServerApiException Class Reference

Exception base class for API exceptions. More...

#include <qgsserverexception.h>

Inheritance diagram for QgsServerApiException:
Inheritance graph
[legend]

Public Member Functions

 QgsServerApiException (const QString &code, const QString &message, const QString &mimeType=QStringLiteral("application/json"), int responseCode=200)
 Construction. More...
 
QByteArray formatResponse (QString &responseFormat) const override
 Formats the exception for sending to client. More...
 
- Public Member Functions inherited from QgsServerException
 QgsServerException (const QString &message, int responseCode=500)
 Constructor. More...
 
int responseCode () const
 
- Public Member Functions inherited from QgsException
 QgsException (const QString &message)
 Constructor for QgsException, with the specified error message. More...
 
virtual ~QgsException ()=default throw ()
 
QString what () const throw ()
 

Detailed Description

Exception base class for API exceptions.

Note that this exception is associated with a default return code 200 which may be not appropriate in some situations.

Since
QGIS 3.10

Definition at line 149 of file qgsserverexception.h.

Constructor & Destructor Documentation

◆ QgsServerApiException()

QgsServerApiException::QgsServerApiException ( const QString &  code,
const QString &  message,
const QString &  mimeType = QStringLiteral( "application/json" ),
int  responseCode = 200 
)
inline

Construction.

Definition at line 153 of file qgsserverexception.h.

Member Function Documentation

◆ formatResponse()

QByteArray QgsServerApiException::formatResponse ( QString &  responseFormat) const
inlineoverridevirtual

Formats the exception for sending to client.

Parameters
responseFormatQString to store the content type of the response format.
Returns
QByteArray The formatted response.

The default implementation returns text/xml format.

Reimplemented from QgsServerException.

Definition at line 160 of file qgsserverexception.h.


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