Class: QgsServerException

Exception base class for server exceptions.

List of all members, including inherited members

Methods

responseCode

Returns the return HTTP response code associated with this exception.

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsServerException. See the FAQ for more details.

formatResponse

Formats the exception for sending to client

class qgis.server.QgsServerException[source]

Bases: object

__init__(message: str | None, responseCode: int = 500)

Constructor

Parameters:
  • message (Optional[str])

  • responseCode (int = 500)

__init__(a0: QgsServerException)
Parameters:

a0 (QgsServerException)

virtual formatResponse(self)[source]

Formats the exception for sending to client

Return type:

(QByteArray, str)

Returns:

  • QByteArray The formatted response.

  • responseFormat: the content type of the response format.

The default implementation returns text/xml format.

responseCode(self) int[source]

Returns the return HTTP response code associated with this exception.

Return type:

int