18#ifndef QGSWMSSERVICEEXCEPTION_H
19#define QGSWMSSERVICEEXCEPTION_H
110 const QString name = parameter.
name();
117 message = QStringLiteral(
"The %1 parameter is missing." ).arg( name );
122 message = QStringLiteral(
"The %1 parameter is invalid." ).arg( name );
127 message = QStringLiteral(
"The format '%1' from %2 is not supported." ).arg( parameter.
toString(), name );
132 message = QStringLiteral(
"The SRS is not valid." );
137 message = QStringLiteral(
"The CRS is not valid." );
142 message = QStringLiteral(
"The layer '%1' does not exist." ).arg( parameter.
toString() );
147 message = QStringLiteral(
"The layer '%1' is not queryable." ).arg( parameter.
toString() );
152 message = QStringLiteral(
"The point '%1' from '%2' is invalid." ).arg( parameter.
toString(), name );
172 const QMetaEnum metaEnum( QMetaEnum::fromType<QgsServiceException::ExceptionCode>() );
173 QString key = metaEnum.valueToKey(
code );
176 key.replace( QLatin1String(
"OGC_" ), QString() );
177 key.replace( QLatin1String(
"QGIS_" ), QString() );
QString locator() const
Returns the locator.
QgsOgcServiceException(const QString &code, const QString &message, const QString &locator=QString(), int responseCode=200, const QString &version=QStringLiteral("1.3.0"))
Construction.
QString message() const
Returns the exception message.
QString code() const
Returns the exception code.
int responseCode() const
Returns the return HTTP response code associated with this exception.
QString toString(bool defaultValue=false) const
Converts the parameter into a string.
QgsBadRequestException(ExceptionCode code, const QgsWmsParameter ¶meter)
Constructor for QgsBadRequestException (HTTP error code 400).
QgsBadRequestException(ExceptionCode code, const QString &message)
Constructor for QgsBadRequestException (HTTP error code 400).
QgsSecurityException(const QString &message, const QString &locator=QString())
Constructor for QgsSecurityException (HTTP error code 403 with Security code name).
QgsServiceException(ExceptionCode code, const QgsWmsParameter ¶meter, int responseCode)
Constructor for QgsServiceException (empty locator attribute).
QgsServiceException(const QString &code, const QString &message, const QString &locator=QString(), int responseCode=200)
Constructor for QgsServiceException.
QgsServiceException(const QString &code, const QString &message, int responseCode)
Constructor for QgsServiceException (empty locator attribute).
ExceptionCode
Exception codes as defined in OGC scpecifications for WMS 1.1.1 and WMS 1.3.0.
@ OGC_CurrentUpdateSequence
@ OGC_OperationNotSupported
@ OGC_InvalidUpdateSequence
@ OGC_InvalidDimensionValue
@ OGC_MissingDimensionValue
@ QGIS_InvalidParameterValue
@ QGIS_MissingParameterValue
QgsServiceException(ExceptionCode code, const QString &message, int responseCode)
Constructor for QgsServiceException (empty locator attribute).
WMS parameter received from the client.
QString name() const
Returns the name of the parameter.
Median cut implementation.