Re: Common exception handling
- From: Martin <martin.dowie@xxxxxxxxxxxxxxx>
- Date: Fri, 29 Aug 2008 01:32:18 -0700 (PDT)
On 26 Aug, 15:43, Adam Beneschan <a...@xxxxxxxxxx> wrote:
On Aug 26, 6:47 am, shaunpatter...@xxxxxxxxx wrote:
Yeah, it looks like the extra layer of exception handling is the only
way. I was hoping I could avoid that if possible.
No, I don't think it's the only way. I'm surprised no one has
suggested this:
exception
when E : others =>
Print_Test (Rec);
declare
use Ada.Exceptions;
begin
if Exception_Identity(E) = A'Identity then
... handling for A
elsif Exception_Identity(E) = B'Identity then
... handling for B
etc.
else
... handling for other exceptions you didn't expect,
... but you certainly need to aware that it could
... happen
raise; --maybe
end if;
end;
-- Adam
Surely you missed a smiley off this suggestion!!! :-)
== Martin
.
- Follow-Ups:
- Re: Common exception handling
- From: Adam Beneschan
- Re: Common exception handling
- References:
- Common exception handling
- From: shaunpatterson
- Re: Common exception handling
- From: shaunpatterson
- Common exception handling
- Prev by Date: Re: Possible compiler bug with this simple program
- Next by Date: Re: Common exception handling
- Previous by thread: Re: Common exception handling
- Next by thread: Re: Common exception handling
- Index(es):
Relevant Pages
|