Trapping and handling errors.
Exercises, examples and other material relating to training module U111. This topic is presented on public courses
Learning to program in Lua,
Lua Programming,
Lua Programming
Examples from our training material
errc | Error handling on file open |
gp0 | 'Control' for error trapping - failing example |
gp1 | trapping an error via pcall |
gp2 | Assert - test a condition and exit with your error if it fails |
protectedcall | pcall to trap errors in a lua function call |
splot | trapping Lua errors - nil and error |
splut | trapping Lua errors - assert |
tbp | Stack Traceback |
wonky | error checking through pcall |
Background information
Some modules are
available for download as a sample of our material or under an
Open Training Notes License for free download from
[here].
Topics covered in this module
Logic, syntax, runtime.
Assert and Error functions.
Error Containment Functions such as pcall
debug.stacktrace
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our
Listing and schedule page.
Well House Consultants specialise in training courses in
Ruby,
Lua,
Python,
Perl,
PHP, and
MySQL. We run
Private Courses throughout the UK (and beyond for longer courses), and
Public Courses at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if
you live in a different
country or continent to us.
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre.