The default behaviour of Invantive Script is to end the execution of a script when an error occurs and to continue when no error occurs.
Using the on error statement with the syntax:
```
local on error SPECIFICATION
```
you can control the behavior when an error occurs. The available variants for specification are:
- `default`: as described above.
- `continue`: remember that an error occurred, continue execution but exit the program with the exit code that would have been raised during default behavior.
- `ignore`: ignore the error and forget it ever occurred.
- `exit success`: exit the program with exit code 0.
- `exit failure`: exit the program with exit code 1.
- `exit warning`: exit the program with exit code 2.