HighlightException

Exception hierarchy for compose-highlight engine failures.

All public HighlightEngine methods return Result<T> and wrap failures in one of these subtypes rather than throwing directly. Catch HighlightException to handle all engine errors in one place, or match individual subtypes for fine-grained handling.

Parameters

message

Human-readable description of the failure.

cause

The underlying throwable that triggered this exception, if any.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class EngineDestroyed @JvmOverloads constructor(cause: Throwable? = null) : HighlightException

Thrown when an engine operation cannot complete because the HighlightEngine was destroyed (via HighlightEngine.destroy or HighlightEngine.close).

Link copied to clipboard

Thrown when the HTML parser fails to parse the HTML returned by Highlight.js.

Link copied to clipboard

Thrown when a JavaScript engine call (e.g. highlightCode, listLanguages, hljsVersion) returns null or raises an error.

Link copied to clipboard
class RendererGone @JvmOverloads constructor(val didCrash: Boolean = false, cause: Throwable? = null) : HighlightException

Thrown when the WebView renderer process terminates unexpectedly, either due to an internal crash or because the system terminated it due to memory pressure.

Link copied to clipboard
class ThemeNotFound @JvmOverloads constructor(path: String, cause: Throwable? = null) : HighlightException

Thrown when a theme CSS asset cannot be found or read, or produces no parseable color rules (e.g. the file is empty or contains only unsupported CSS).

Link copied to clipboard

Thrown when a highlight call does not complete within TIMEOUT_SECONDS seconds.

Link copied to clipboard

Thrown when the hidden WebView cannot be created or its bridge page fails to load.

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard
open val message: String?