[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: unwind_protect & try/catch combined corner case
From: |
Søren Hauberg |
Subject: |
Re: unwind_protect & try/catch combined corner case |
Date: |
Thu, 07 Jan 2010 14:08:07 +0100 |
tor, 07 01 2010 kl. 13:36 +0100, skrev Jaroslav Hajek:
> Maybe the whole matter is just too much
> of a corner case for anyone to really care.
It really does sound like an obscure corner case. But how about this
semi-real-world example?
function main ()
try
do_stuff_in_dir ("some/directory");
catch
warning ("An error occurred, but I don't care");
end_try_catch
endfunction
function do_stuff_in_dir (directory)
unwind_protect
wd = pwd ();
cd (directory);
do_stuff ();
unwind_protect_cleanup
# this will raise an error because I forgot the parenthesis
cd wd
end_unwind_protect
endfunction
In this case, I will not get an error, right? I think it would be really
helpful if I got the error message from 'cd'. So, I think it might be
good if errors raised during interrupt handling could not get caught.
Soren
unwind_protect & try/catch combined corner case, John W. Eaton, 2010/01/07