Lua Programming/How to Lua/error handling

From Wikibooks, open books for an open world
< Lua Programming‎ | How to Lua
Jump to: navigation, search

Execution Errors [edit]

When an execution error occurs in a lua script, execution returns to the caller programme for appropriate action to be taken.

Explicit error generation [edit]

The error function can be used to generate an explicit error status.

Error trap [edit]

The pcall function can be used as an error trap.