Hi,
when calling functions known to raise exceptions, its always good
practice to enclose calls with begin ... rescue ... end and catch
exceptions locally.
Catching exceptions should cover known problems (i.e. missing
permissions) as well as generic problems.
Example:
WRONG:
call_function_which_might_raise
NOT ENOUGH:
begin
call_function_which_might_raise
rescue KnownException => e
handle_known_exception e
end
GOOD:
begin
call_function_which_might_raise
rescue KnownException => e
handle_known_exception e
rescue Exception => e
handle_generic_exception e
end
The 'wrong' and 'not enough' cases validate bug reports.
Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]