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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1096a7986b560ad6 X-Google-Attributes: gid103376,public From: "Paul Van Bellinghen" Subject: Re: In Exception ? Date: 1998/04/04 Message-ID: <6g660e$khm$1@news.mhv.net>#1/1 X-Deja-AN: 341534801 References: <35214b7a.0@news.profinet.at> X-Server-Date: 4 Apr 1998 20:42:54 GMT X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: MHVNet Newsgroups: comp.lang.ada Date: 1998-04-04T20:42:54+00:00 List-Id: > >My problem: I want to establish a routine that is called out of normal >flow, or out of an exception handler. How can I get the knowledge whether I >am 'in' an exception (means in its processing) or not. Is there a sort of >function than can be coded like > > if in_exception_handler then > ... > else > ... > end if; > > Couldn't you just add a Boolean variable to your calling sequence that you set to TRUE if you call the procedure from an exception handler and FALSE if you call it from normal flow. Or else use an enumeration variable that is set to either EXCEPTION or NORMAL: -------------------------------------------------- Procedure Foo(...) is Type Calling_Source_Type is (Exception, Normal); Calling_Source : Calling_Source_Type . . Calling_Source := Normal; Handler (Calling_Source); Exception: Calling_Source := Exception; Handler (Calling_Source); -------------------------------------------------- Procedure Handler (From_Where : Calling_Source_Type) is . . if From_Where = Exception then . .. End IF; --------------------------------------------------