Skip to content

Commit

Permalink
Add a QgsProcessingException exception
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 23, 2017
1 parent 2906d1f commit 53e7ef8
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/core/qgsexception.sip
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/core/CMakeLists.txt
Expand Up @@ -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
Expand Down
35 changes: 35 additions & 0 deletions src/core/processing/qgsprocessingexception.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.