Skip to content
Permalink
Browse files

Add QgsNotSupportedException, for operations which are not supported

  • Loading branch information
nyalldawson committed May 4, 2021
1 parent f093c17 commit 2f2797318f025717da71ecb5e85c9095939c7601
Showing with 28 additions and 0 deletions.
  1. +12 −0 python/core/qgsexception.sip
  2. +16 −0 src/core/qgsexception.h
@@ -46,3 +46,15 @@
SIP_UNBLOCK_THREADS
%End
};

%Exception QgsNotSupportedException(SIP_Exception) /PyName=QgsNotSupportedException/
{
%TypeHeaderCode
#include <qgsexception.h>
%End
%RaiseCode
SIP_BLOCK_THREADS
PyErr_SetString(sipException_QgsNotSupportedException, sipExceptionRef.what().toUtf8().constData() );
SIP_UNBLOCK_THREADS
%End
};
@@ -108,5 +108,21 @@ class CORE_EXPORT QgsProviderConnectionException: public QgsException

};

/**
* \class QgsNotSupportedException
* \ingroup core
* \brief Custom exception class which is raised when an operation is not supported.
* \since QGIS 3.20
*/
class CORE_EXPORT QgsNotSupportedException : public QgsException
{
public:

/**
* Constructor for QgsNotSupportedException, with the specified error \a message.
*/
QgsNotSupportedException( const QString &message ) : QgsException( message ) {}

};

#endif

0 comments on commit 2f27973

Please sign in to comment.