From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,e315b3232f1093b0 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Exception handler does not catch an exception Followup-To: comp.lang.ada Date: Sun, 14 Jun 2009 16:12:31 +0200 Message-ID: <79kepoF1r9uqqU1@mid.individual.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: individual.net kn3l6jRgUSzGy41RrAecjwckI2fKOkwmcopwFEC3L1yJk/Q/k= Cancel-Lock: sha1:ac0hse378BN056Uo3zF+QJPLH3o= User-Agent: KNode/4.3.0 pre Xref: g2news2.google.com comp.lang.ada:6469 Date: 2009-06-14T16:12:31+02:00 List-Id: Rick wrote: > I am using an exception handler in the mainline of my program: > > exception > when Error : PROGRAM_ERROR => > Put_Line (Exception_Message (Error)); > Get_Line (Line, Last); > when Another_Error : others => > Put_Line (Exception_Message (Another_Error)); > Get_Line (Line, Last); > end Phone_Keyboard; > > but I still get an error message: > > D:\ProgrammingFiles\Widgets\PhoneKeyboard\Phone_Keyboard > > Execution terminated by unhandled exception > Exception name: PROGRAM_ERROR > Message: EXCEPTION_ACCESS_VIOLATION > Call stack traceback locations: > 0x4483c5 0x7c9032a6 0x7c903278 0x7c90e488 0x407289 0x4017f2 0x401235 > 0x401286 0x7c817075 > [2009-06-08 10:48:19] process exited with status1 (elapsed time: > 03.28s) > > > Why is my exception handler not handling the exception? Besides the reason for this, some exceptions (e.g. Storage_Error after an invalid pointer dereference) can't be "handled away", in the sense that having a handle for them won't prevent program termination. They appear for example when your program is dying from an access violation, and in my experience, sometimes the program dies before handling, or shortly after, but in any case it is doomed.