[Issue 4223] New: Throwing exception in finally block hides original exception

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 23 02:42:55 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4223

           Summary: Throwing exception in finally block hides original
                    exception
           Product: D
           Version: 2.041
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: nfxjfg at gmail.com


--- Comment #0 from nfxjfg at gmail.com 2010-05-23 02:42:52 PDT ---
The message for assertion "a" will never be displayed, even though it certainly
fails:

void main() {
    try {
        assert(false, "a");
    } finally {
        assert(false, "b");
    }
}

Executing this program should display messages for both cases. Otherwise, it
may be impossible to tell what actually failed: assertion b may depend on
cleanup code that was supposed to be executed after assertion a. It is not
unusual that other, seemingly unrelated, assertions fail once the program's
state is "corrupted".

Suggested fix: link the exceptions via Throwable.next.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list