# Error handler

The Error Handler allows you to gracefully manage potential errors thrown by a function. It provides a separate output that will only activate if the function it's attached to fails or throws an exception.

This enables you to build a safe, separate logic path to handle error conditions, such as logging the error details to a database or displaying a user-friendly error message on the UI.

<figure><img src="https://3495989837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE5Ketpww1s7TauSAJrJ8%2Fuploads%2Fms9eKoTE0EDpFCjhmpxR%2Fimage.png?alt=media&#x26;token=d7d92de1-9853-4a0c-b14b-2f83b26d8959" alt=""><figcaption><p>Error simulator function with captured error message and JSONata modification.</p></figcaption></figure>
