bugban library

Bugban error and performance monitoring for Dart.

This package is framework-agnostic: it knows how to describe an error, parse a Dart stack trace, keep an offline queue and talk to the ingest API, and nothing else. In a Flutter app use bugban_flutter, which wires this up to FlutterError, PlatformDispatcher, the navigator and screenshots.

The split follows the same shape as the PHP and JavaScript families — one core, thin adapters — so a pure Dart CLI or a server can report errors too.

Classes

A step the user or the app took before the error.
Bugban
Process-wide client.
BugbanClient
The Bugban client.
BugbanHttpClient
HTTP call tracking.
BugbanOptions
Configuration for the Bugban client.
EventStore
Where the offline queue lives between app launches.
MemoryEventStore
In-memory store. Useful in tests; pointless in production, where the whole point is surviving a restart.
QueueCodec
Encode/decode the queue. Kept here so the client and every store agree on one format, and so a corrupt payload degrades to "empty" instead of an exception on the startup path.
StackFrame
One parsed frame, in the shape the ingest API expects from every SDK.
Transport
HTTP delivery to the Bugban ingest API.

Constants

sdkName → const String
sdkVersion → const String
SDK version. Must match pubspec.yaml and bugban_flutter's pubspec.

Functions

describeError(Object error) → ({String message, String type})
Class name and message for an arbitrary thrown object.
parseStackTrace(Object? trace, {int limit = 60}) List<StackFrame>
Parse a StackTrace (or its string form) into frames, topmost first.

Exceptions / Errors

BugbanHttpError
The error object a failed HTTP call is reported as.