mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-12 00:06:43 -04:00
[processing] Always log python exceptions to logger
Because Python code cannot catch and rethrow c++ exceptions without losing context, we end up getting unknown exceptions caught by c++ from python code (phew!). So if we catch a python exception from processing, throw it into the log so at least there's the full debugging detail available on the console. (Not ideal. Would love to see a PR allowing the full error message to be passed correctly between c++/python/back again)
This commit is contained in:
parent
615cb6ca71
commit
f4445a0493
@ -6,6 +6,7 @@ ${DEFAULTDOCSTRINGSIGNATURE}
|
||||
%ModuleCode
|
||||
|
||||
#include "qgsexception.h"
|
||||
#include "qgslogger.h"
|
||||
|
||||
QString getTraceback()
|
||||
{
|
||||
@ -107,6 +108,7 @@ done:
|
||||
|
||||
%VirtualErrorHandler processing_exception_handler
|
||||
QString trace = getTraceback();
|
||||
QgsLogger::critical( trace );
|
||||
SIP_RELEASE_GIL( sipGILState );
|
||||
throw QgsProcessingException( trace );
|
||||
%End
|
||||
|
Loading…
x
Reference in New Issue
Block a user