Re: Exception: unknown instead of the expected one
Alessandro Pasotti <[email protected]>
| Newsgroups | gmane.comp.python.pyqt-pykde |
|---|---|
| Message-ID | <CAL5Q671JMFdNT6d_gxED8yMXo+6hp5MZd3YeSRM572RfGjR=Sw@mail.gmail.com> |
Nevermind, my bad: I was throwing "new" exceptions instead of allocating them on the stack. On Tue, Aug 6, 2019 at 2:49 PM Alessandro Pasotti <[email protected]> wrote: > Hi, > > I've added an exception in the SIP file: > > %Exception QgsProviderConnectionException(SIP_Exception) > /PyName=QgsProviderConnectionException/ > { > %TypeHeaderCode > #include <qgsexception.h> > %End > %RaiseCode > SIP_BLOCK_THREADS > PyErr_SetString(sipException_QgsProviderConnectionException, > sipExceptionRef.what().toUtf8().constData() ); > SIP_UNBLOCK_THREADS > %End > }; > > then, in the class method: > > virtual void executeSql( const QString &sql) throw( > QgsProviderConnectionException ); > > but when calling from Python I always get Exception: unknown, what is > possible going wrong? > > Thanks > > -- > Alessandro Pasotti > w3: www.itopen.it > -- Alessandro Pasotti w3: www.itopen.it _______________________________________________ PyQt mailing list [email protected] https://www.riverbankcomputing.com/mailman/listinfo/pyqt