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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,951a3a1a55d59148 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-11 07:10:12 PST Path: archiver1.sj.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!uio.no!news.netg.se!dd.chalmers.se!not-for-mail From: f97stdi@dd.chalmers.se (Staffan Dittmer) Newsgroups: comp.lang.ada Subject: Re: error recovery Date: 11 May 2001 14:02:50 GMT Organization: Chalmers University of Technology, Sweden Message-ID: <9dgrea$3db$1@eol.dd.chalmers.se> References: <3afbe7e2.191078067@news.nl.uu.net> NNTP-Posting-Host: palantir.dd.chalmers.se Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Newsreader: knews 1.0b.1 Xref: archiver1.sj.google.com comp.lang.ada:7391 Date: 2001-05-11T14:02:50+00:00 List-Id: In article <3afbe7e2.191078067@news.nl.uu.net>, serious@clerk.com (Noam Kloos) writes: > But after exception has been raised the program ends. > So my way to do it was; when Name_Error; Create File, call the program > itself. > > Is there a better way to realise error recovery in Ada? > Noam. > Guess you should check the ARM about the range(?) of exceptions. The solution to your problem is adding a new block inside your main program, or a procedure, that handles the exception locally without interrupting the rest of your program. In your case a block solution would be open_file_block: begin Open(File_Log,Append_File,Log_File_Name); exception when Name_Error => Create(File_Log,In_File,Log_File_Name); end open_file_block; then do all the putting things.... / Staffan