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.4 required=5.0 tests=BAYES_00,SUBJ_ALL_CAPS autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,94868228472d8299 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!nntp.abs.net!news.abs.net!not-for-mail Newsgroups: comp.lang.ada Subject: Re: OWN EXCEPTION NOT HANDLED References: <1133351325.417716.228260@g43g2000cwa.googlegroups.com> From: Stephen Leake Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:LxMTP3dOk79IGymn1qZBS6I7b4Q= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 30 Nov 2005 07:45:29 -0500 NNTP-Posting-Host: 66.159.65.1 X-Complaints-To: abuse@toad.net X-Trace: news.abs.net 1133354731 66.159.65.1 (Wed, 30 Nov 2005 07:45:31 EST) NNTP-Posting-Date: Wed, 30 Nov 2005 07:45:31 EST Xref: g2news1.google.com comp.lang.ada:6677 Date: 2005-11-30T07:45:29-05:00 List-Id: "rashmi" 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