> For the complete documentation index, see [llms.txt](https://sron.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sron.gitbook.io/docs/exit-codes.md).

# Exit codes

To indicate if a program ran successfully or had problem, exit codes are used.

<mark style="color:yellow;">Exit codes are the numeric values which tells the operating system that the executable ran successfully or not.</mark>

SRON's interpreter returns these exit codes:

* <mark style="color:yellow;">0</mark>: code ran successfully with no errors and exceptions.
* <mark style="color:yellow;">1</mark>: code ran into errors caused by logical issues.
* <mark style="color:yellow;">2</mark>: code tries to access a memory which it doesn't own.
* <mark style="color:yellow;">3</mark>: Your system has no memory left.
* <mark style="color:yellow;">4</mark>: code raises an exception thrown by std::exception of C++.
* <mark style="color:yellow;">5</mark>: Your source code is calling **throwException()** function.
* <mark style="color:yellow;">6</mark>: code exited due to stack overflow(mostly due to deep recursions).
* <mark style="color:yellow;">7</mark>: code terminated due to `SIGINT` signal (Ctrl+C).
* <mark style="color:yellow;">8</mark>: code terminated due to `SIGKILL` signal (kill \<pid>).
* <mark style="color:yellow;">9</mark>: code terminated due to `SIGBREAK` signal(Ctrl+Enter).
* <mark style="color:yellow;">10</mark>: code terminated due to `SIGTERM` signal(Shutdown).
* <mark style="color:yellow;">11</mark>: code terminated due to `SIGABRT` signal(Abort).
* <mark style="color:yellow;">12</mark>: code terminated due to `SIGSEGV` signal(Segmentation Fault).
* <mark style="color:yellow;">13</mark>: code terminated due to unknown signal(or the signal not handled by SRON's interpreter).
