After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 505557 - Unexpected recursion with error handling
Unexpected recursion with error handling
Status: RESOLVED DUPLICATE of bug 530212
Product: vala
Classification: Core
Component: general
0.1.x
Other All
: Normal normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2007-12-25 12:53 UTC by Jürg Billeter
Modified: 2008-05-17 13:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jürg Billeter 2007-12-25 12:53:28 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.
Comment 1 Jürg Billeter 2008-05-17 13:14:11 UTC
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 ***