lua-l archive
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
] [
Date Index
] [
Thread Index
]
Subject
:
Re: Dealing With Errors in Lua
From
: Rena <hyperhacker@
...
>
Date
: Sat, 28 Sep 2013 11:03:15 -0400
On Fri, Sep 27, 2013 at 2:30 PM, petah
<
lua@laufenberg.ch
>
wrote:
> (try/catch sure would be nice to have!)
It would if there were free, but they're not :)
I wonder what all the cost would be? I'm thinking of them as essentially a syntax sugar for pcall/xpcall, so:
try
do_things()
catch(ex)
report_error(ex)
end
would translate to:
local ok, ex = pcall(function() --or xpcall?
do_things()
end); if not ok then
report_error(ex)
end
the idea being to just make it a little less ugly. :)
--
Sent from my Game Boy.
Follow-Ups
:
Re: Dealing With Errors in Lua
,
Sven Olsen
References
:
Dealing With Errors in Lua
,
Rena
Re: Dealing With Errors in Lua
,
petah
Prev by Date:
Re: Lua Distributions and Package Management
Next by Date:
Re: Dealing With Errors in Lua
Previous by thread:
Re: Dealing With Errors in Lua
Next by thread:
Re: Dealing With Errors in Lua
Index(es):
Date
Thread