Use of "catch (...)" swallows exceptions

Bug #1106586 reported by Paul J. Lucas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
New
Medium
Ghislain Fourny

Bug Description

In store.cpp for the loadDocument() function, a "catch (...)" is used without rethrowing the exception via "throw;" The problem is that the "catch (...)" swallows all other exceptions silently. This causes very hard-to-find bugs (as I recently had the misfortune of debugging).

The rule should be that if you ever write "catch (...)," the end of the catch block should ALWAYS rethrow the exception via "throw;". The catch block in this way only does some clean-up but makes no attempt to swallow the exception.

Note that I have already cleaned up several other uses of "catch (...)" in the code (see bug #1103819). This bug is a related bug in that it's about the (mis)use of "catch (...)" but specifically a case I don't feel comfortable fixing myself. There is already a branch for all "catch (...)" fixes -- please use the bug-1103819 branch.

Related branches

Changed in zorba:
assignee: ghislain_cote (ghislain) → nobody
assignee: nobody → Ghislain Fourny (gislenius)
Changed in zorba:
milestone: 2.9 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.