---
title: "LocalCompositionErrorContext"
description: "Used 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."
type: "property"
---

<div class='type'>Property</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
public val LocalCompositionErrorContext: CompositionLocal<CompositionErrorContext?>
```


Used 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.



