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.

Inheritors

Constructors

Link copied to clipboard
constructor(errorCode: ErrorCode, message: String, vararg causes: Throwable?)

Properties

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard

The error code associated with this exception, indicating the type of error that occurred.

Link copied to clipboard
expect open val message: String?

Functions

Link copied to clipboard
open override fun toString(): String