Board Thread:Lua Help/@comment-24473195-20140813090251/@comment-11733175-20140814093319

Yeah, pcall is essentially your try catch method that you might find in javascript or python. I use this in places to output my own error message e.g. message that doesn't add the script error category to pages I don't want it to.

error isn't something I've experimented with myself. You might be better off asking around wikipedia's lua help (wikipedia:WP:Lua maybe?) or their technical help board which I think is in the teahouse somewhere. I've never done much beyond a handful of edits on wikipedia so I'm not entirely sure. Or you can try asking around #wikipedia or #wikipedia-en on IRC.