Bug report #19798

voronoi.py swallows exceptions

Added by john kastner almost 6 years ago. Updated almost 6 years ago.

Affected QGIS version:3.3(master) Regression?:No
Operating System: Easy fix?:Yes
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:27623


On line 362 of voronoi.py, there is the line `except Exception as err:` which is used to swallow all exceptions thrown in the method `voronoi`. This is generally a bad idea and and is making my life a lot harder while debugging an issue I'm having with the Voronoi Polygons geometry tool.


My suggested fix is to remove this try/except block so that exceptions can propagate up the stack freely. It may be better to instead modify the expect statement to catch only some relevant exceptions that actually should be ignored.

Associated revisions

Revision 0cc9501d
Added by john kastner almost 6 years ago

Remove try-except block in voronoi.py fixes #19798

This block was swallowing all exceptions within the voronoi method.
Removing the block causes exceptions throw in the method to propagate up
the stack and eventually become visible in log files.


#2 Updated by john kastner almost 6 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

#3 Updated by Giovanni Manghi almost 6 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF