CompositionErrorContext


Provides a way to attach a compose stack trace to a throwable based on a location of compose node in composition. This context is expected to be used by custom node implementations to attach diagnostic compose stack traces to exceptions in passes that are not handled by the Compose runtime (example: measure / layout / draw in Compose UI).

Compose runtime automatically appends information about exceptions that happen in composition and effects.

Summary

Public functions

Boolean

Attaches a Compose stack trace to a throwable as a suppressed DiagnosticComposeException.

Cmn

Public functions

attachComposeStackTrace

fun Throwable.attachComposeStackTrace(composeNode: Any): Boolean

Attaches a Compose stack trace to a throwable as a suppressed DiagnosticComposeException. Has no effect if:

Parameters
Throwable

throwable to attach a compose stack trace to

composeNode: Any

closest node to where exception was originally thrown

Returns
Boolean

true if the exception was attached, false otherwise