Bug report #19798
voronoi.py swallows exceptions
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Processing/Core | ||
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 |
Description
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.
https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/qgis/voronoi.py#L362
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
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.
History
#1 Updated by john kastner about 6 years ago
pull request: https://github.com/qgis/QGIS/pull/7832
#2 Updated by john kastner about 6 years ago
- % Done changed from 0 to 100
- Status changed from Open to Closed
Applied in changeset qgis|0cc9501df70503e40bb00dc97970436541d65551.
#3 Updated by Giovanni Manghi about 6 years ago
- Resolution set to fixed/implemented