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,FREEMAIL_FROM, 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!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 30 Nov 2005 20:32:58 -0600 From: "Steve" Newsgroups: comp.lang.ada References: <1133351325.417716.228260@g43g2000cwa.googlegroups.com> Subject: Re: OWN EXCEPTION NOT HANDLED Date: Wed, 30 Nov 2005 18:34:23 -0800 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Message-ID: NNTP-Posting-Host: 24.20.111.245 X-Trace: sv3-L6GD+4T6okrqIEV77xMeonJK5a7NW2Taj8UB7RmxpIJpuPvdn0id/RmPeZ++xmQBkxODBAcwczweWRn!70UZJi4Fz8JbcSfR2dZTRXady90CtcDKEUc4byZge5HitVkqO1nZ6YqgtqIvNNIgYQSgPlnq5ESF!rW20lWcwgqxrPA== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:6701 Date: 2005-11-30T18:34:23-08:00 List-Id: "rashmi" wrote in message news:1133351325.417716.228260@g43g2000cwa.googlegroups.com... > 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? > Try: when Constraint_Error => Steve (The Duck)