Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge sentry #8

Merged
merged 39 commits into from
Oct 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
05d3907
can parse a Sentry DSN
yjbanov Jun 20, 2017
bbc9da8
able to send a crash report with basic data
yjbanov Jun 20, 2017
c0df06c
travis build
yjbanov Jun 20, 2017
cce0e9f
dartfmt; single-job travis
yjbanov Jun 20, 2017
d0064e3
Travis badge
yjbanov Jun 20, 2017
095750d
structured API for many basic event attributes
yjbanov Jun 21, 2017
cc502dd
rename tools => tool; make it pub publisheable
yjbanov Jun 21, 2017
5377010
compress payloads by default
yjbanov Jun 21, 2017
069f434
unhardcode version number in test
yjbanov Jun 21, 2017
1c7a984
move environment-specific attributes from Event to SentryClient
yjbanov Jun 21, 2017
f039e9d
implement x-sentry-error header; enforce immutability
yjbanov Jun 21, 2017
f935a8c
parse and report stack traces
yjbanov Jun 21, 2017
0540fc0
populate README with useful stuff (#1)
yjbanov Jun 21, 2017
aaa90bf
auto-generate event_id and timestamp for events
yjbanov Jun 22, 2017
6230c79
environment attriutes; v0.0.3
yjbanov Jun 22, 2017
b2b5afc
parse and report async gaps (#1)
yjbanov Aug 7, 2017
56d544a
remove sub-seconds from the timestamp format (#2)
yjbanov Aug 15, 2017
e3945aa
update authors and readme (#3)
yjbanov Aug 15, 2017
0f2131f
submit date-time in UTC format (#4)
yjbanov Sep 18, 2017
4ed2ee8
#fixes 14747 assert for Dart 2 (#6)
zoechi Feb 16, 2018
b5dcb6b
forgot to update the changelog (#8)
zoechi Feb 27, 2018
bcdefdc
minor cleanup (#7)
zoechi Mar 2, 2018
ee4c346
release 1.0.0 - the last Dart 1 compatible major version (#11)
yjbanov Mar 20, 2018
a922746
1.0.0 changelog (#12)
yjbanov Mar 20, 2018
a0c2524
Fixes tests and deprecation warnings for Dart2 (#9)
pulyaevskiy Mar 21, 2018
7348e10
small clean-ups; sdk version constraint (#13)
yjbanov Mar 21, 2018
3d21b1e
fix Dart 2 type issue in a test (#15)
yjbanov Apr 26, 2018
f611b80
Fixed "Culprit" recording in Sentry (#14)
slightfoot Apr 26, 2018
8650283
bump version to 2.0.1 (#16)
yjbanov Apr 26, 2018
78ef3f7
Support user context (#17)
dustin-graham May 15, 2018
5715d15
minor dartdoc clean-up; 2.0.2 version bump (#18)
yjbanov May 15, 2018
1b9b7fb
Support for new DSN format (without secretKey) and remove the quiver …
slightfoot Jul 30, 2018
5167a5c
version 2.1.0; minor dartdoc clean-up (#21)
yjbanov Jul 30, 2018
856e6f2
Bump upper bound of 'mockito' dependency (#24)
dotdoom Oct 9, 2018
044e4c1
mergeAttributes: deepcopy RHS Map if LHS isn't Map (#23)
dotdoom Oct 9, 2018
4fc8381
version 2.1.1; changelog update (#25)
yjbanov Oct 9, 2018
5926e24
Fix link to runZoned docs (#26)
filiph Oct 18, 2018
86f77dd
relocate package to packages/sentry prior to merging with flutter/pac…
kf6gpe Oct 26, 2018
6781992
Merge sentry package with packages.
kf6gpe Oct 26, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
.DS_Store
.atom/
.idea
.dart_tool/
.packages
.pub/
pubspec.lock

Podfile.lock
Pods/
GeneratedPluginRegistrant.h
GeneratedPluginRegistrant.m

GeneratedPluginRegistrant.java

pubspec.lock
packages/sentry/build/
packages/sentry/android/
packages/sentry/ios/
8 changes: 8 additions & 0 deletions packages/sentry/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions packages/sentry/.idea/sentry.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions packages/sentry/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions packages/sentry/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: dart
dart:
# - stable # there's no Dart 2 on the stable channel yet
- dev
script: ./tool/presubmit.sh
7 changes: 7 additions & 0 deletions packages/sentry/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Below is a list of people and organizations that have contributed
# to package:sentry. Names should be added to the list like so:
#
# Name/Organization <email address>

Google Inc.
Simon Lightfoot <simon@devangels.london>
58 changes: 58 additions & 0 deletions packages/sentry/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# package:sentry changelog

## 2.1.1

- Defensively copy internal maps event attributes to
avoid shared mutable state (https://github.com/flutter/sentry/commit/044e4c1f43c2d199ed206e5529e2a630c90e4434)

## 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
27 changes: 27 additions & 0 deletions packages/sentry/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2014 The Chromium Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17 changes: 17 additions & 0 deletions packages/sentry/PATENTS
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Google hereby grants to you a perpetual, worldwide, non-exclusive,
no-charge, royalty-free, irrevocable (except as stated in this
section) patent license to make, have made, use, offer to sell, sell,
import, transfer, and otherwise run, modify and propagate the contents
of this implementation, where such license applies only to those
patent claims, both currently owned by Google and acquired in the
future, licensable by Google that are necessarily infringed by this
implementation. This grant does not include claims that would be
infringed only as a consequence of further modification of this
implementation. If you or your agent or exclusive licensee institute
or order or agree to the institution of patent litigation or any other
patent enforcement activity against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that this
implementation constitutes direct or contributory patent infringement,
or inducement of patent infringement, then any patent rights granted
to you under this License for this implementation shall terminate as
of the date such litigation is filed.
60 changes: 60 additions & 0 deletions packages/sentry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Sentry.io client for Dart

[![Build Status](https://travis-ci.org/flutter/sentry.svg?branch=master)](https://travis-ci.org/flutter/sentry)

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`:

```yaml
dependencies:
sentry: any
```

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

```dart
import 'package:sentry/sentry.dart';

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

In an exception handler, call `captureException()`:

```dart
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][run_zoned]
- in Flutter, use [FlutterError.onError][flutter_error]
- use `Isolate.current.addErrorListener` to capture uncaught errors in the root zone

[run_zoned]: https://api.dartlang.org/stable/dart-async/runZoned.html
[flutter_error]: https://docs.flutter.io/flutter/foundation/FlutterError/onError.html

## Found a bug?

Please file it at https://github.com/flutter/flutter/issues/new
51 changes: 51 additions & 0 deletions packages/sentry/bin/test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:async';
import 'dart:io';

import 'package:sentry/sentry.dart';

/// Sends a test exception report to Sentry.io using this Dart client.
Future<Null> main(List<String> rawArgs) async {
if (rawArgs.length != 1) {
stderr.writeln(
'Expected exactly one argument, which is the DSN issued by Sentry.io to your project.');
exit(1);
}

final String dsn = rawArgs.single;
final SentryClient client = new SentryClient(dsn: dsn);

try {
await foo();
} catch (error, stackTrace) {
print('Reporting the following stack trace: ');
print(stackTrace);
final SentryResponse response = await client.captureException(
exception: error,
stackTrace: stackTrace,
);

if (response.isSuccessful) {
print('SUCCESS\nid: ${response.eventId}');
} else {
print('FAILURE: ${response.error}');
}
} finally {
await client.close();
}
}

Future<Null> foo() async {
await bar();
}

Future<Null> bar() async {
await baz();
}

Future<Null> baz() async {
throw new StateError('This is a test error');
}
Loading