---
title: "Track your app's errors with a Sentry SDK: the while.sh docs"
url: https://while.sh/en/docs/building-blocks/errors/
updated: 2026-11-09
---

# Errors (Sentry)

Your app's exceptions, grouped by a Sentry SDK connected to while. A never-seen-before error wakes your agent.

> You, to your agent: Set up error tracking.

## What your app receives

Your app receives these environment variables at every deployment:

| Variable | What it holds |
|---|---|
| `SENTRY_DSN` | The address where the Sentry SDK sends the server's errors. |
| `SENTRY_DSN_PUBLIC` | The one for an SDK running in the browser. |

## When to use it

Use it to group the app's exceptions with a Sentry SDK. A new error wakes the agent.

## How it works

Plug any Sentry SDK into `SENTRY_DSN`: errors are grouped, and a never-seen error wakes the agent.

## What to know

`SENTRY_DSN` is an internal address, reachable without opening `egress`. For an SDK in the browser, use `SENTRY_DSN_PUBLIC`.

## Guides

- [Track your app's errors with a Sentry SDK, without a Sentry account, from your AI agent](/en/guides/track-errors-sentry/)
