QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Member Functions | List of all members
QgsServerException Class Reference

Exception base class for server exceptions. More...

#include <qgsserverexception.h>

Inheritance diagram for QgsServerException:
Inheritance graph
[legend]

Public Member Functions

 QgsServerException (const QString &message, int responseCode=500)
 Constructor. More...
 
virtual QByteArray formatResponse (QString &responseFormat) const
 Formats the exception for sending to client. 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 server exceptions.

Definition at line 41 of file qgsserverexception.h.

Constructor & Destructor Documentation

◆ QgsServerException()

QgsServerException::QgsServerException ( const QString &  message,
int  responseCode = 500 
)

Constructor.

Definition at line 23 of file qgsserverexception.cpp.

Member Function Documentation

◆ formatResponse()

QByteArray QgsServerException::formatResponse ( QString &  responseFormat) const
virtual

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 in QgsOgcServiceException, and QgsServerApiException.

Definition at line 30 of file qgsserverexception.cpp.

◆ responseCode()

int QgsServerException::responseCode ( ) const
inline
Returns
the return HTTP response code associated with this exception

Definition at line 54 of file qgsserverexception.h.


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