lua-users home
lua-l archive

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


On Tuesday 20 December 2005 19:23, Dolan, Ryanne Thomas (UMR-Student) wrote:
> or you could redefine error() to write to stdout in Lua:

The problem with that is that if his code calls another module which uses its 
own error() implementation, it'll still invoke the default error handler 
which will write to stdout.

Catching errors with pcall and using a custom error handler avoids this 
(equivalent to registering a global exception handler).

-- 
+- David Given --McQ-+ 
|  dg@cowlark.com    | HORAY FOR POKEY THE PENGUIN!
| (dg@tao-group.com) | 
+- www.cowlark.com --+ 

Attachment: pgphiGwJcy4ej.pgp
Description: PGP signature