comp.lang.ada
 help / color / mirror / Atom feed
From: "Alex R. Mosteo" <alejandro@mosteo.com>
Subject: Re: Exception handler does not catch an exception
Date: Sun, 14 Jun 2009 16:12:31 +0200
Date: 2009-06-14T16:12:31+02:00	[thread overview]
Message-ID: <79kepoF1r9uqqU1@mid.individual.net> (raw)
In-Reply-To: b75654d0-00d5-47cc-97b9-ee29bee6e58e@q2g2000vbr.googlegroups.com

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.



      parent reply	other threads:[~2009-06-14 14:12 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
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 [this message]
replies disabled

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