Capturing Python Error

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Capturing Python Error

Raúl Sangonzalo Terrado
Hi, is it possible to capture Python Errors? I mean, I have been able to log most of them, but I want to capture the error in red within the Python error Dialog.

image.png

This is what I have used so far:

def errorCatcher(msg, tag, level):
    QMessageBox.information(iface.mainWindow(), "Error", msg)
QgsApplication.messageLog().messageReceived.connect(errorCatcher)

Many thanks,
Raúl

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Capturing Python Error

Peter Petrik
Hi,

try to look at first aid plugin https://plugins.qgis.org/plugins/firstaid/

Cheers, 
Peter

On Wed, May 29, 2019 at 12:43 PM Raúl Sangonzalo <[hidden email]> wrote:
Hi, is it possible to capture Python Errors? I mean, I have been able to log most of them, but I want to capture the error in red within the Python error Dialog.

image.png

This is what I have used so far:

def errorCatcher(msg, tag, level):
    QMessageBox.information(iface.mainWindow(), "Error", msg)
QgsApplication.messageLog().messageReceived.connect(errorCatcher)

Many thanks,
Raúl
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user