sentry 2.1.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 91

Sentry.io client for Dart

Build Status

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.

Versions

>=0.0.0 <2.0.0 is the range of versions compatible with Dart 1.

>=2.0.0 <3.0.0 is the range of versions compatible with Dart 2.

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

2.1.1

2.1.0

  • Support DNS format without secret key.
  • Remove dependency on package:quiver.
  • The clock argument to SentryClient constructor should now be ClockProvider (but still accepts Clock for backwards compatibility).

2.0.2

  • Add support for user context in Sentry events.

2.0.1

  • Invert stack frames to be compatible with Sentry's default culprit detection.

2.0.0

  • Fixed deprecation warnings for Dart 2
  • Refactored tests to work with Dart 2

1.0.0

  • first and last Dart 1-compatible release (we may fix bugs on a separate branch if there's demand)
  • fix code for Dart 2

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

Use this package as a library

1. Depend on it

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


dependencies:
  sentry: ^2.1.1

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 flutter 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
2.1.1 Oct 9, 2018 Go to the documentation of sentry 2.1.1 Download sentry 2.1.1 archive
2.1.0 Jul 30, 2018 Go to the documentation of sentry 2.1.0 Download sentry 2.1.0 archive
2.0.2 May 15, 2018 Go to the documentation of sentry 2.0.2 Download sentry 2.0.2 archive
2.0.1 Apr 26, 2018 Go to the documentation of sentry 2.0.1 Download sentry 2.0.1 archive
2.0.0 Mar 21, 2018 Go to the documentation of sentry 2.0.0 Download sentry 2.0.0 archive
1.0.0 Mar 21, 2018 Go to the documentation of sentry 1.0.0 Download sentry 1.0.0 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

All 12 versions...

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

We analyzed this package on Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4

Platforms

Detected platforms: Flutter, other

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

Health suggestions

Fix lib/sentry.dart. (-0.50 points)

Analysis of lib/sentry.dart reported 1 hint:

line 200 col 14: 'GZIP' is deprecated and shouldn't be used.

Maintenance suggestions

The description is too short. (-20 points)

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

Maintain an example. (-10 points)

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
Dart SDK >=2.0.0-dev.28.0 <3.0.0
http >=0.11.0 <2.0.0 0.12.0
meta >=1.0.0 <2.0.0 1.1.6
stack_trace >=1.0.0 <2.0.0 1.9.3
usage >=3.0.0 <4.0.0 3.4.1
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
path 1.6.2
source_span 1.4.1
string_scanner 1.0.4
typed_data 1.1.6
Dev dependencies
args >=0.13.0 <2.0.0
mockito >=2.0.0 <4.0.0
test >=0.12.0 <2.0.0
yaml >=2.1.0 <3.0.0