POV-Ray : Newsgroups : povray.off-topic : Funniest bug ever : Re: Funniest bug ever Server Time
29 Jul 2024 04:22:41 EDT (-0400)
  Re: Funniest bug ever  
From: Jim Henderson
Date: 25 Feb 2013 11:34:53
Message: <512b92ad@news.povray.org>
On Sun, 24 Feb 2013 23:38:16 +0100, clipka wrote:

> Am 24.02.2013 20:49, schrieb Jim Henderson:
>> On Sun, 24 Feb 2013 12:21:51 +0000, Orchid Win7 v1 wrote:
>>
>>> On 24/02/2013 12:03 PM, Warp wrote:
>>>> Orchid Win7 v1<voi### [at] devnull>  wrote:
>>>>> I agree. However, unfortunately it seems that by default Bash
>>>>> ignores all such errors and happily proceeds, unless you manually
>>>>> suffix every single command with an explicit return-code check.
>>>>
>>>> How is that different from any programming language?
>>>
>>> In C#, Java or similar, if you try to open a file and can't, an
>>> exception is thrown, and your program is halted. (Unless you thought
>>> of that eventuality and coded a catch{} block for it.) In Bash, the
>>> program continues to execute as if everything worked just fine,
>>> silently ignoring the error.
>>
>> The exception handling part is a feature of OO programming languages,
>> IIRC.  Bash scripting is far from OOP. ;)
> 
> Exception handling is not an OOP feature. And yes, bash /does/ have it:
> 
>    set -e trap "echo aborted by user || kill -INT $$" INT trap "echo
>    aborted by other process || kill -TERM $$" TERM trap "echo error
>    reported" EXIT
> 
>      ... critical section ...
> 
>    set +e trap - INT trap - TERM trap - EXIT

Interesting, I didn't know that.  Thanks!

Jim


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.