> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Exception Reporting

Errors from your functions reach an outside service through
[log export](https://docs.bijection.com/operate/observability/log-export.md), the same export that sends
every log line. There is no per-vendor exception integration. Sentry, Datadog,
PostHog and most other error trackers ingest OpenTelemetry logs, either
directly or through an OpenTelemetry Collector.

## Sending errors

Place an OpenTelemetry export that keeps only `error` lines:

```ts bijection/app.ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { app, secret } from "@bijectionhq/bijection";
import { logExport, otlp } from "@bijectionhq/library-log-export";

const otlpToken = secret();

export default app({
  otlpToken,
  errors: logExport(otlp("https://otlp.example.com", { bearer: otlpToken }), {
    site: "orders.place",
    levels: ["error"],
    resource: { "service.name": "orders" },
  }),
});
```

Then set the token it presents: `bijection secret set otlpToken`.

## What an error carries

Each `console.error` line is one OpenTelemetry log record with
`severityNumber` 17 (`ERROR`). It carries the message as its body, the
function's tree path as `code.function.name`, and the run as
`bijection.execution`. When the run was refused, the record also carries the
refusal's code as `bijection.refusal.code` and its reason as
`bijection.refusal.reason`. Group or alert on those attributes in your error
tracker. The full mapping is in
[OpenTelemetry records](https://docs.bijection.com/operate/observability/log-export.md#opentelemetry-records).

A refused run that logged nothing has no line to export. Log the error you
handle (`console.error(error)`) where you want it reported.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.