Invantive Data Hub ends with an exit code which says whether the run succeeded. A scheduler or batch file decides on that code whether the next step may run. The codes are shared with the other Invantive programs and are listed once in [[Exit Codes/Exit Codes|Exit Codes]]; the table below adds the message code Invantive Data Hub prints with each one.
| Code | Meaning |
| --- | --- |
| 0 | Successful. |
| 1 | Warning: something was reported, but the program completed. |
| 2 | User error, such as a statement which the engine refused or a platform which returned an error. |
| 3 | System error, raised by code outside Invantive, such as a file error of the operating system. |
| 4 | Failure while starting or while making the first connection. |
| 5 | Fatal error. A command line argument in an invalid format ends here, with `itgendhb002`. From release 27.0 onward two more command lines end here: a script file together with a statement (`itgendhb297`) and a `/statement` whose statement is missing (`itgendhb298`); see [[Invantive Data Hub/Command Line Options|Command Line Options]]. |
| 6 | Unhandled exception; the program met a situation it could not resolve. |
| 7 | The application was closed because it may not be used, for instance when no licence key is configured or the agreement has not been accepted (`itgenlic681`). |
| 8 | No exit code available. |
| 9 | The program could not start at all. A missing or unreadable `appsettings` file ends here, with `itgencuy002`; see [[Invantive Data Hub/Configuration|Configuration]]. |
| 130 | The run was interrupted. CTRL-C on the console, or SIGINT. Available from release 27.0. |
| 143 | The run was asked to stop by its environment: SIGTERM, SIGQUIT, SIGHUP, a closed console window, a log-off or a shut-down. `docker stop` and most schedulers end a run this way. Available from release 27.0. |
The last line of the output names the code before the program ends, as `itgendhb041: End program execution with exit code 0.`, followed by `itgendhb068: Program finished`.
Codes 0 through 4 are the outcome of the run itself; 5 through 9 mean the run never properly took place. The two high codes say the run was stopped from outside and follow the convention of a shell, which reports a program ended by signal number N as 128 plus N.
## Stopping A Run
Available from release 27.0. A run which is asked to stop finishes the statement it is on, starts no further statement and then ends. The last line of the output is `itgendhb291`, which names the exit code and states that a statement which was underway may be half finished.
Stopping is bounded in time, because the environment which asks for it is counting down as well: Microsoft Windows allows a console application about five seconds after its window is closed and `docker stop` sends a kill signal ten seconds after asking. The run therefore stops within four seconds and spends at most two more on registering the run with Invantive. Signalling a second time within ten seconds ends the run at once, without that registration.
Anything the run started through [[Invantive Script/Statements/Host|local host]] or [[Invantive UniversalSQL/Packages/dbms_os|dbms_os]] is ended together with the run, including the programs those started in turn.
Two details are worth knowing. At the interactive `INVANTIVE>` prompt CTRL-C ends the run rather than only discarding the line being typed. And the run is registered as stopped rather than as failed, so a stopped run does not count towards the failure statistics of the licence.