[Qgis-user] quit() and exit()

Stephen Sacks ssacks456 at gmail.com
Tue May 3 11:29:43 PDT 2022


In case there may be someone out there who is interested in my question, 
below is Asim's answer (with one correction he made).    When run in the 
Python console, this code causes execution of the script to stop and a 
window to pop up titled "Execution error" with my explanatory message.  
And, unlike quit() and exit(), it does NOT terminate QGIS.

fName = 'xyz'
vrbl = False
class MyExcpt(Exception):
     pass

if not vrbl:
     raise MyExcpt("Unable to find file %s" % fName)

print ('abc')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220503/01a861fc/attachment.htm>


More information about the Qgis-user mailing list