# `sc_crawler.sentry`

> Report errors to Sentry when the `SENTRY_DSN` environment variable is set.

# `sc_crawler.sentry`

**Functions:**

- [**before_send**](#before_send) – Do not report intended shutdown errors to sentry.
- [**sentry_capture_or_raise**](#sentry_capture_or_raise) – Capture exception with Sentry and continue if configured, otherwise re-raise.

## func <code class="doc-name">before_send</code> [sentry.py:14–28](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/sentry.py#L14-L28)

```python
before_send(event, hint)
```

Do not report intended shutdown errors to sentry.

## func <code class="doc-name">sentry_capture_or_raise</code> [sentry.py:31–60](https://github.com/SpareCores/sc-crawler/blob/81bb61ea164dda526de4aa6de298810007274f21/src/sc_crawler/sentry.py#L31-L60)

```python
sentry_capture_or_raise(vendor, on_error=None)
```

Capture exception with Sentry and continue if configured, otherwise re-raise.

**Parameters:**

- **vendor** ([`Vendor`](https://docs.sparecores.com/crawler/reference/tables.md#vendor)) – Vendor to use for logging and progress bar updates.
- **on_error** ([`Optional`](https://docs.python.org/3/library/typing.html#typing.Optional)`[`[`Callable`](https://docs.python.org/3/library/typing.html#typing.Callable)`]`) – Optional zero-argument callable, invoked before capturing or
re-raising (e.g. for logging or state updates).
