[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: A die(reason) or exit function is missing, isn't it?
- From: "Jerome Vuarand" <jerome.vuarand@...>
- Date: Thu, 25 Jan 2007 16:57:53 -0500
Jan Schütze wrote:
> so I should call the mainfunction with pcall and ignore its
> message this way?
> Hmm, should be possible - but looks like an evil hack :-).
In fact it's not an evil hack, it's the way error management works in Lua. It's similar to exceptions in C++. Whether Lua errors or C++ exceptions are a good way to report errors is a religious debate, but in both case it's a reliable, well defined and powerful mechanism. Whether you use it or abuse it is up to you.