lua-users home
lua-l archive

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


Hello,

so I should call the mainfunction with pcall and ignore its message this way?
Hmm, should be possible - but looks like an evil hack :-).

Thanks for fast response, hope that lua-devs implement a die, so such workaround isn't needed.

Kind regards,
 Jan (DracoBlue)
-------------------------
   http://dracoblue.net


Alex Queiroz schrieb:
Hallo,

On 1/25/07, Jan Schütze <JanS@dracoblue.de> wrote:

This isn't only used to report an error to users on website.
Since I use lua for webpublishing, I have somewher ein my source a
function called xml_render() - this one, should use die at the end, to
prevent from showing header and stuff when the rest of the script is
executed. The issue is, that this function is called mostly somewhere in
a set of sets of function-sets, so its not possible (easily, without
making the source unreadable) to do this via using if-else-constructs.


    You can catch the error before it reaches the user with pcall().