GNOME Bugzilla – Bug 505557
Unexpected recursion with error handling
Last modified: 2008-05-17 13:14:11 UTC
Reported by Phil Housley: Throwing an error in a catch block acts as though you are still in the try block. Test case: using GLib; [ErrorDomain] enum TestError { ERROR } class Test { public static void fail() throws TestError { throw new TestError.ERROR(""); } public static void main(string[] args) { try { fail(); } catch (TestError ex) { stdout.printf("Error caught\n"); fail(); } } } This will loop forever, as each time the second "fail()" call is made, the app will test the error condition, and loop back to the same goto as the original catch.
Thanks for taking the time to report this bug. This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed. It should be solved in the next software version. You may want to check for a software upgrade. *** This bug has been marked as a duplicate of 530212 ***