comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@acm.org>
Subject: Re: OWN EXCEPTION NOT HANDLED
Date: Wed, 30 Nov 2005 07:45:29 -0500
Date: 2005-11-30T07:45:29-05:00	[thread overview]
Message-ID: <uwtiq5mom.fsf@acm.org> (raw)
In-Reply-To: 1133351325.417716.228260@g43g2000cwa.googlegroups.com

"rashmi" <rashmi.thoras@gmail.com> writes:

> Dear reader
>
> Inside a function I defined an exception of my own that is equivalent
> to an exception of  constraint- error type. I have also created the
> associated exception handler as shown next:
> _________________
>     :
> if RE_ScDSGA.IN_RanSeq <  0   then raise EX_RsqIvd; end if;
> if RE_ScDSGA.IN_RanSeq >  1   then raise EX_RsqIvd; end if;
>     :
>     :
> exception
>     when EX_RsqIvd => put_line("EXCEPTION: Invalid key INPUT for random
> seq");
> return RE_ScDSGA;
>     :
> ___________________
>
> There were no compiler errors or warnings. Now when a value of 2 was
> supplied for the field variable IN_RanSeq, a constraint error would be
> expected. But instead of handling this constraint error as I have
> defined above, Ada handled it on its own by raising Constraint_Error.
>
> My question is how do I get Ada to handle the constraint error from my
> own handler rather than from the handler of its own?

We need to see the full code to be able to answer this;
Constraint_Error must be raised on some line you are not showing.

-- 
-- Stephe



  reply	other threads:[~2005-11-30 12:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-30 11:48 OWN EXCEPTION NOT HANDLED rashmi
2005-11-30 12:45 ` Stephen Leake [this message]
2005-12-01 10:34   ` rashmi
2005-12-01  2:34 ` Steve
replies disabled

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