Skip to content
Permalink
Browse files

Add a QgsProcessingException exception

  • Loading branch information
nyalldawson committed Jun 23, 2017
1 parent 2906d1f commit 53e7ef88a37b937d287949bc642de85ed34ac3aa
Showing with 48 additions and 0 deletions.
  1. +12 −0 python/core/qgsexception.sip
  2. +1 −0 src/core/CMakeLists.txt
  3. +35 −0 src/core/processing/qgsprocessingexception.h
@@ -10,6 +10,18 @@
%End
};

%Exception QgsProcessingException(SIP_Exception) /PyName=QgsProcessingException/
{
%TypeHeaderCode
#include <qgsprocessingexception.h>
%End
%RaiseCode
SIP_BLOCK_THREADS
PyErr_SetString(sipException_QgsProcessingException, sipExceptionRef.what().toUtf8().constData() );
SIP_UNBLOCK_THREADS
%End
};

%Exception QgsException(SIP_Exception) /PyName=QgsException/
{
%TypeHeaderCode
@@ -899,6 +899,7 @@ SET(QGIS_CORE_HDRS
processing/qgsnativealgorithms.h
processing/qgsprocessingalgorithm.h
processing/qgsprocessingcontext.h
processing/qgsprocessingexception.h
processing/qgsprocessingmodelalgorithm.h
processing/qgsprocessingoutputs.h
processing/qgsprocessingparameters.h
@@ -0,0 +1,35 @@
/***************************************************************************
qgsprocessingalgexception.h
------------------------
begin : June 2017
copyright : (C) 2017 by Nyall Dawson
email : nyall dot dawson at gmail dot com
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef QGSPROCESSINGEXCEPTION_H
#define QGSPROCESSINGEXCEPTION_H

#include "qgis_core.h"
#include "qgsexception.h"

/**
* \class QgsProcessingException
* \ingroup core
* Custom exception class for processing related exceptions.
*/
class CORE_EXPORT QgsProcessingException : public QgsException
{
public:
QgsProcessingException( const QString &what ) : QgsException( what ) {}

};
#endif // QGSPROCESSINGEXCEPTION_H

0 comments on commit 53e7ef8

Please sign in to comment.
You can’t perform that action at this time.