EngineErrorCodes.wiki
author Wuzzy
Wed, 28 Jun 2023 06:03:32 +0000
changeset 2253 1bd9936f6b01
parent 1873 0b0c0a66ebf7
permissions -rw-r--r--
TODO: Teaching AI new weapons is not an "easy hack"

#summary Description and list of engine error codes

= Engine error codes =
When the Hedgewars engine (`hwengine`) crashes or is closed, it returns an exit code (or error code) which can be used to further analyze the problem.

== List of engine error codes ==
This is the list of all possible error codes:

|| *Exit code* || *Meaning* || *Description* || *Solution* ||
|| 0 || No error || Engine exited normally || N/A ||
|| 51 || Usage error || The engine was launched with invalid command line arguments || Check your command-line arguments. Type `hwengine --help` in a command line for help ||
|| 52 || Fatal error || Generic error for critical errors at runtime || Check the error message or the end of the log files in `Logs` in your [http://hedgewars.org/wiki/User_directory user directory] for clues ||
|| 53 || Startup error || Failure while initializing stuff on startup, like graphics, shader, OpenGL stuff, etc. || Check your [Dependencies dependencies] and if you have the latest video drivers installed and update them as needed ||
|| 54 || Fatal error, no IPC socket || Similar to error 52, but the IPC socket is not working for some reason || Check the log files in `Logs` in your [http://hedgewars.org/wiki/User_directory user directory] for clues ||
|| Other || Free Pascal run-time error, see [https://www.freepascal.org/docs-html/user/userap4.html here] || This is probably a bug. Or it might be a problem in your system. || If you believe this is a bug, [http://www.hedgewars.org/bugs report a bug], then someone should fix it ||

== Error codes when performing engine test cases ==
When the engine is used to perform [EngineTestCases test cases], the follwing additional codes are used:

|| *Exit code* || *Meaning* || *Solution* ||
|| 0 || Test succeeded || N/A ||
|| 60 || Test failed || Fix the engine ||
|| 61 || Lua error in test case || Fix the Lua code of the test case ||
|| 62 || Unexpected error while testing || Debug ||

= Source code =
The exit codes are defined in the source code file [https://hg.hedgewars.org/hedgewars/file/tip/hedgewars/uConsts.pas hedgewars/uConsts.pas].