ExitProgramException
open class ExitProgramException(val errorCode: ErrorCode, message: String, causes: Throwable?) : Exception(source)
Exception type that signals the program should terminate with a specific error code.
This exception is designed to handle critical errors that require program termination, associating them with a specific error code for proper exit status reporting. It supports multiple causes, where the first cause is set as the primary cause via the standard Exception mechanism, and additional causes are added as suppressed exceptions.
The exception provides enhanced string representation that lists all non-null causes when multiple causes are present, making it easier to debug complex error scenarios.
Parameters
message
A descriptive message explaining why the program needs to exit.