Class: QgsServerException

Exception base class for server exceptions.

Methods

formatResponse

Formats the exception for sending to client

responseCode

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)

formatResponse(self)[source]

Formats the exception for sending to client

Returns:

  • QByteArray The formatted response.

  • responseFormat: QString to store the content type of the response format.

The default implementation returns text/xml format.

responseCode(self) int[source]
Return type:

int

Returns:

the return HTTP response code associated with this exception