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

# Flutter — Error Tracking

> Report errors and exceptions from your Flutter app to the Atelerix dashboard.

## Introduction

Atelerix captures errors and exceptions from your Flutter app so you can debug issues faster. After you complete the [Flutter installation](/frameworks/flutter/installation), use `Atelerix.throwError` to send custom errors or caught exceptions to your dashboard.

<Note>
  Make sure you have initialized the SDK with `Atelerix.init()` before reporting errors.
</Note>

## Report an error

Use `Atelerix.throwError` to manually report an error. This is useful when you catch an exception in a `try/catch` block and want to send it to Atelerix with extra context.

```dart main.dart theme={null}
try {
  await riskyOperation();
} catch (e, stack) {
  await Atelerix.throwError(
    e,
    stack,
    bugSeverity: BugSeverity.high,
    metaData: {
      'userId': '123',
      'action': 'payment',
      'amount': 100.0,
    },
  );
}
```

### Parameters

| Parameter     | Type                   | Required | Description                                |
| ------------- | ---------------------- | -------- | ------------------------------------------ |
| `error`       | `Object`               | Yes      | Error object or message                    |
| `stack`       | `StackTrace`           | Yes      | Stack trace associated with the error      |
| `bugType`     | `BugType`              | No       | Bug classification                         |
| `bugSeverity` | `BugSeverity`          | No       | Severity level                             |
| `metaData`    | `Map<String, dynamic>` | No       | Additional context to attach to the report |

### `BugType` values

| Value             | Description                                          |
| ----------------- | ---------------------------------------------------- |
| `runtimeError`    | An unhandled exception thrown at runtime             |
| `logicBug`        | Incorrect behavior that doesn't throw                |
| `uiBug`           | A visual or layout defect                            |
| `networkError`    | A failed or malformed network request                |
| `performance`     | Slowness, jank, or excessive resource use            |
| `compatibility`   | Breaks on a specific device, OS version, or platform |
| `validationError` | Invalid input passed validation it shouldn't have    |
| `security`        | A security-relevant defect                           |
| `crash`           | The app terminated unexpectedly                      |
| `unknown`         | None of the above                                    |

### `BugSeverity` values

| Value      | Description                                    |
| ---------- | ---------------------------------------------- |
| `critical` | Blocks core functionality or affects all users |
| `high`     | Serious impact, but a workaround exists        |
| `medium`   | Noticeable but limited impact                  |
| `low`      | Minor or cosmetic                              |
| `unknown`  | Severity not yet assessed                      |

### Automatic error capture

Once `Atelerix.init()` has run, uncaught Flutter framework errors (via `FlutterError.onError`) and uncaught Dart errors (via `PlatformDispatcher.instance.onError`) are captured and sent automatically — you don't need to wrap your whole app in a `try`/`catch` to get baseline coverage. `Atelerix.throwError` is for cases you catch yourself and want to add classification or metadata to.

### Verify the integration

Throw a test error to confirm everything is working:

```dart main.dart theme={null}
await Atelerix.throwError(
  Exception('Test error'),
  StackTrace.current,
);
```

Then open your [dashboard](https://app.atelerix.com) — the error should appear within seconds.
