comp.lang.ada
 help / color / mirror / Atom feed
From: f97stdi@dd.chalmers.se (Staffan Dittmer)
Subject: Re: error recovery
Date: 11 May 2001 14:02:50 GMT
Date: 2001-05-11T14:02:50+00:00	[thread overview]
Message-ID: <9dgrea$3db$1@eol.dd.chalmers.se> (raw)
In-Reply-To: 3afbe7e2.191078067@news.nl.uu.net

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




  reply	other threads:[~2001-05-11 14:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-11 13:30 error recovery Noam Kloos
2001-05-11 14:02 ` Staffan Dittmer [this message]
2001-05-11 14:42   ` Ehud Lamm
replies disabled

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