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-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!37g2000yqp.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Exception handler does not catch an exception Date: Mon, 8 Jun 2009 00:37:41 -0700 (PDT) Organization: http://groups.google.com Message-ID: <888cd2aa-6e79-4816-9976-bd6a8f3e83f5@37g2000yqp.googlegroups.com> References: NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1244446661 19734 127.0.0.1 (8 Jun 2009 07:37:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 8 Jun 2009 07:37:41 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 37g2000yqp.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6363 Date: 2009-06-08T00:37:41-07:00 List-Id: On Jun 8, 5:19=A0am, Rick wrote: > I am using an exception handler in the mainline of my program: > > exception > =A0 =A0when Error : PROGRAM_ERROR =3D> > =A0 =A0 =A0 Put_Line (Exception_Message (Error)); > =A0 =A0 =A0 Get_Line (Line, Last); > =A0 =A0when Another_Error : others =3D> > =A0 =A0 =A0 Put_Line (Exception_Message (Another_Error)); > =A0 =A0 =A0 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? I can see three possible reasons but I cannot be sure if you don't post your entire program. Possible cause 1: exception during elaboration, i.e. before your main subprogram starts. Possible cause 2: exception during elaboration of the main subprogram's local variables, i.e. before its "begin" keyword. Possible cause 3: exception in a task other than the environment task. The stack trace points you to the exact location of the problem. -- Ludovic Brenta.