Re: [QGIS-Developer] Retrieving error details for when a loaded layer is not valid

2021-11-27 Thread Alessandro Pasotti
Hi, you can try with https://qgis.org/pyqgis/3.0/core/Data/QgsDataProvider.html#qgis.core.QgsDataProvider.error On Sat, Nov 27, 2021 at 12:11 AM Ricardo Filipe Soares Garcia da < ricardo.garcia.si...@gmail.com> wrote: > Hi list > > When loading a vector layer via Python, is there a way to get

Re: [QGIS-Developer] Retrieving error details for when a loaded layer is not valid

2021-11-26 Thread G. Allegri
Hi Ricardo, have you tried increasing the debug level? I often raise it at 9 using the QGIS_DEBUG env var. >From a quick look at the source code of QgsVectorLayer two cases where the valid flag is set to false

[QGIS-Developer] Retrieving error details for when a loaded layer is not valid

2021-11-26 Thread Ricardo Filipe Soares Garcia da
Hi list When loading a vector layer via Python, is there a way to get a hold of the error message for when the loading fails? I can check if the layer is valid or not, but I'd like to get a description of the error. I see the error on the QGIS log panel, so I'm hoping it is possible to access it