comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Exception handler does not catch an exception
Date: Mon, 8 Jun 2009 00:37:41 -0700 (PDT)
Date: 2009-06-08T00:37:41-07:00	[thread overview]
Message-ID: <888cd2aa-6e79-4816-9976-bd6a8f3e83f5@37g2000yqp.googlegroups.com> (raw)
In-Reply-To: b75654d0-00d5-47cc-97b9-ee29bee6e58e@q2g2000vbr.googlegroups.com

On Jun 8, 5:19 am, Rick <rickdu...@gmail.com> 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?

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.



  parent reply	other threads:[~2009-06-08  7:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-08  3:19 Exception handler does not catch an exception Rick
2009-06-08  5:16 ` anon
2009-06-08  7:21   ` rickduley
2009-06-08 11:40     ` anon
2009-06-08  7:37 ` Ludovic Brenta [this message]
2009-06-09 10:50   ` Stephen Leake
2009-06-09  2:01 ` rickduley
2009-06-09  7:26   ` Dmitry A. Kazakov
2009-06-10 10:06   ` Stephen Leake
2009-06-14 14:12 ` Alex R. Mosteo
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox