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')
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to