sentry 0.0.6

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 95

Sentry.io client for Dart

Build Status

WARNING: experimental code

Use this library in your Dart programs (Flutter, command-line and (TBD) AngularDart) to report errors thrown by your program to https://sentry.io error tracking service.

Usage

Sign up for a Sentry.io account and get a DSN at http://sentry.io.

Add sentry dependency to your pubspec.yaml:

dependencies:
  sentry: any

In your Dart code, import package:sentry/sentry.dart and create a SentryClient using the DSN issued by Sentry.io:

import 'package:sentry/sentry.dart';

final SentryClient sentry = new SentryClient(dsn: YOUR_DSN);

In an exception handler, call captureException():

main() async {
  try {
    doSomethingThatMightThrowAnError();
  } catch(error, stackTrace) {
    await sentry.captureException(
      exception: error,
      stackTrace: stackTrace,
    );
  }
}

Tips for catching errors

  • use a try/catch block
  • create a Zone with an error handler, e.g. using runZoned
  • in Flutter, use FlutterError.onError
  • use Isolate.current.addErrorListener to capture uncaught errors in the root zone

Found a bug?

Please file it at https://github.com/flutter/flutter/issues/new

package:sentry changelog

0.0.6

  • use UTC in the timestamp field

0.0.5

  • remove sub-seconds from the timestamp

0.0.4

  • parse and report async gaps in stack traces

0.0.3

  • environment attributes
  • auto-generate event_id and timestamp for events

0.0.2

  • parse and report stack traces
  • use x-sentry-error HTTP response header
  • gzip outgoing payloads by default

0.0.1

  • basic ability to send exception reports to Sentry.io

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  sentry: "^0.0.6"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:sentry/sentry.dart';
        
Version Uploaded Documentation Archive
0.0.6 Sep 18, 2017 Go to the documentation of sentry 0.0.6 Download sentry 0.0.6 archive
0.0.5 Aug 15, 2017 Go to the documentation of sentry 0.0.5 Download sentry 0.0.5 archive
0.0.4 Aug 7, 2017 Go to the documentation of sentry 0.0.4 Download sentry 0.0.4 archive
0.0.3 Jun 23, 2017 Go to the documentation of sentry 0.0.3 Download sentry 0.0.3 archive
0.0.2 Jun 21, 2017 Go to the documentation of sentry 0.0.2 Download sentry 0.0.2 archive
0.0.1 Jun 21, 2017 Go to the documentation of sentry 0.0.1 Download sentry 0.0.1 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
90 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
95

Platforms

Detected platforms: Flutter, other

Primary library: package:sentry/sentry.dart with components: io.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use sentry.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
http >=0.11.0 <2.0.0 0.11.3+16
meta >=1.0.0 <2.0.0 1.1.2
quiver >=0.25.0 <2.0.0 0.28.0
stack_trace >=1.0.0 <2.0.0 1.9.1
usage >=3.0.0 <4.0.0 3.3.0
Transitive dependencies
async 2.0.3
charcode 1.1.1
collection 1.14.5
http_parser 3.1.1
matcher 0.12.1+4
path 1.5.1
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5
Dev dependencies
args >=0.13.0 <2.0.0
mockito >=2.0.0 <3.0.0
test >=0.12.0 <2.0.0
yaml >=2.1.0 <3.0.0