# Syntax
The behaviour of the program can be controlled when an error occurs using the syntax:
```
local on error SPECIFICATION
```
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.
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 behaviour.
- `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.
# Examples
The following example ensures that the program ends immediately on an error:
```
local on error exit failure
```
The following example ensures that the program does not end on an error, but instead reports the error when the last statement has been executed:
```
local on error continue
```