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.2 required=5.0 tests=BAYES_00,FROM_LOCAL_HEX, FROM_STARTS_WITH_NUMS autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1a4156f047b063f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Vinzent Hoefler" <0439279208b62c95f1880bf0f8776eeb@t-domaingrabbing.de> Newsgroups: comp.lang.ada Subject: Re: Forcing Exception Handling Date: Tue, 01 Mar 2011 10:47:01 +0100 Message-ID: References: <02901b13-da72-48ae-9cb3-bf1a10144c44@u3g2000vbe.googlegroups.com> <4d6c07c1$0$6885$9b4e6d93@newsspool2.arcor-online.net> <195bsgigtzacu$.13u18z09ptrtw$.dlg@40tude.net> <91988389-b17a-42cb-8f5b-9b1205604b55@y3g2000vbh.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: individual.net 5odVWoBS0Uc5PFGxr7rjKADGM26jmBy9m3Jt4fPxpUfIbAL2JU Cancel-Lock: sha1:uPVyf+xRgj9XALx/StnEnEODlUM= User-Agent: Opera Mail/11.01 (Win32) Xref: g2news2.google.com comp.lang.ada:18641 Date: 2011-03-01T10:47:01+01:00 List-Id: iloAda wrote: > Actually the idea behind my question was that I'm working on a real > time system, and as u know, we can't afford to a let a real time > system crash because of an unhandled exception. Since I use some other > libraries in my system (that weren't written by myself or anybody else > I know) that will raise exceptions, I wanted to be forced to handle > them. Better not to let them raised at all. I know, this may not be easy, but it's the most reliable solution. > One solution might be to just put the following code everywhere (even > though I don't like this): > > exception > When others => > -- Do something that will allow the system to keep on running This is dangerous. Especially when doing it "everywhere". Ignoring errors has never been a good idea, especially for the unexpected ones. > have u guys done something like that before? Occasionally, yes. At the outermost task level to log the exception that caused the system to crash. If you do that inside a loop, you might be able to restart the affected task from there. But if you have more than one task and they interact with each other, fault recovery like that gets quite complex, because then things like data consistency within the whole system may be at risk. And you don't want that to happen. Vinzent. -- A C program is like a fast dance on a newly waxed dance floor by people carrying razors. -- Waldi Ravens