← All platforms

Dart error tracking

A Dart script or service deserves a useful report when it throws. The Sentry Dart SDK sends those errors to Telebugs on your server.

~/hoofnotes  dart pub add sentry
~/hoofnotes  nvim bin/hoofnotes.dart
import 'package:sentry/sentry.dart';
Future<void> main() async {
await Sentry.init((options) {
// Copy the complete DSN, key and path included.
options.dsn = 'YOUR_TELEBUGS_DSN';
});
try {
throw StateError('Hello from Hoof Notes');
} catch (error, backtrace) {
await Sentry.captureException(error, stackTrace: backtrace);
} finally {
await Sentry.close();
}
}
~/hoofnotes  dart run

Space pauses or resumes. R replays. Escape shows the complete setup.

Hang on, I already use Sentry

Keep sentry and change its destination to your Telebugs DSN. Your error reports stay on your server. You don’t need a Sentry account.

Which Dart exceptions can I report?

The SDK can send a Dart exception with its backtrace, including one you catch yourself. Keep both together so the report points back to where the failure happened.

Is this a Flutter native crash guide?

No. This page covers Dart application errors. Native mobile crash reports and their symbolication are outside this setup.