sentry 2.0.2

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

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.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.0.2"

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.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
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

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

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
91 / 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
Learn more about scoring.

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.

  • 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.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 hint.

    Strong-mode analysis of lib/sentry.dart gave the following hint:

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

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.11.3+16
meta >=1.0.0 <2.0.0 1.1.5
quiver >=0.25.0 <2.0.0 0.29.0+1
stack_trace >=1.0.0 <2.0.0 1.9.2
usage >=3.0.0 <4.0.0 3.4.0
Transitive dependencies
async 2.0.7
charcode 1.1.1
collection 1.14.10
http_parser 3.1.2
matcher 0.12.2+1
path 1.6.0
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