<div dir="ltr"><div>Nevermind, my bad: I was throwing "new" exceptions instead of allocating them on the stack.</div><div></div><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 6, 2019 at 2:49 PM Alessandro Pasotti <<a href="mailto:apasotti@gmail.com">apasotti@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>I've added an exception in the SIP file:<br></div><div><br></div><div>%Exception QgsProviderConnectionException(SIP_Exception) /PyName=QgsProviderConnectionException/<br>{<br>%TypeHeaderCode<br>#include <qgsexception.h><br>%End<br>%RaiseCode<br> SIP_BLOCK_THREADS<br> PyErr_SetString(sipException_QgsProviderConnectionException, sipExceptionRef.what().toUtf8().constData() );<br> SIP_UNBLOCK_THREADS<br>%End<br>};</div><div><br></div><div>then, in the class method:</div><div><br></div><div>virtual void executeSql( const QString &sql) throw( QgsProviderConnectionException );</div><div><br></div><div>but when calling from Python I always get Exception: unknown, what is possible going wrong?</div><div><br></div><div>Thanks</div><div><br></div><div>-- <br><div dir="ltr" class="gmail-m_-1953814426991502971gmail_signature">Alessandro Pasotti<br>w3: <a href="http://www.itopen.it" target="_blank">www.itopen.it</a></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Alessandro Pasotti<br>w3: <a href="http://www.itopen.it" target="_blank">www.itopen.it</a></div></div>