lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

>From: Ken Rawlings <>
>   What i'm thinking of is more along the lines of something like Java/C++
>   exception handling:
>   try 
>     -- do something   
>   catch
>     -- if an error occurred
>   finally
>     -- always done
>   end

If "do something" can be put into a function, then the code above can be written

	if call(do_something,args,"x") then
		-- catch error
	-- always done

"call" also accepts a function to serve as temporary error handler.