diff --git a/README.md b/README.md index 1bd7d9579e..0708590823 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,6 @@ # 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. +This repository has been DEPRECATED. This package is now part of the +[flutter/packages](https://github.com/flutter/packages) repository. -## 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 diff --git a/.idea/modules.xml b/packages/sentry/.idea/modules.xml similarity index 100% rename from .idea/modules.xml rename to packages/sentry/.idea/modules.xml diff --git a/.idea/sentry.iml b/packages/sentry/.idea/sentry.iml similarity index 100% rename from .idea/sentry.iml rename to packages/sentry/.idea/sentry.iml diff --git a/.idea/vcs.xml b/packages/sentry/.idea/vcs.xml similarity index 100% rename from .idea/vcs.xml rename to packages/sentry/.idea/vcs.xml diff --git a/.travis.yml b/packages/sentry/.travis.yml similarity index 100% rename from .travis.yml rename to packages/sentry/.travis.yml diff --git a/AUTHORS b/packages/sentry/AUTHORS similarity index 100% rename from AUTHORS rename to packages/sentry/AUTHORS diff --git a/CHANGELOG.md b/packages/sentry/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to packages/sentry/CHANGELOG.md diff --git a/LICENSE b/packages/sentry/LICENSE similarity index 100% rename from LICENSE rename to packages/sentry/LICENSE diff --git a/PATENTS b/packages/sentry/PATENTS similarity index 100% rename from PATENTS rename to packages/sentry/PATENTS diff --git a/packages/sentry/README.md b/packages/sentry/README.md new file mode 100644 index 0000000000..1bd7d9579e --- /dev/null +++ b/packages/sentry/README.md @@ -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 diff --git a/bin/test.dart b/packages/sentry/bin/test.dart similarity index 100% rename from bin/test.dart rename to packages/sentry/bin/test.dart diff --git a/lib/sentry.dart b/packages/sentry/lib/sentry.dart similarity index 100% rename from lib/sentry.dart rename to packages/sentry/lib/sentry.dart diff --git a/lib/src/stack_trace.dart b/packages/sentry/lib/src/stack_trace.dart similarity index 100% rename from lib/src/stack_trace.dart rename to packages/sentry/lib/src/stack_trace.dart diff --git a/lib/src/utils.dart b/packages/sentry/lib/src/utils.dart similarity index 100% rename from lib/src/utils.dart rename to packages/sentry/lib/src/utils.dart diff --git a/lib/src/version.dart b/packages/sentry/lib/src/version.dart similarity index 100% rename from lib/src/version.dart rename to packages/sentry/lib/src/version.dart diff --git a/pubspec.yaml b/packages/sentry/pubspec.yaml similarity index 100% rename from pubspec.yaml rename to packages/sentry/pubspec.yaml diff --git a/test/sentry_test.dart b/packages/sentry/test/sentry_test.dart similarity index 100% rename from test/sentry_test.dart rename to packages/sentry/test/sentry_test.dart diff --git a/test/stack_trace_test.dart b/packages/sentry/test/stack_trace_test.dart similarity index 100% rename from test/stack_trace_test.dart rename to packages/sentry/test/stack_trace_test.dart diff --git a/test/utils_test.dart b/packages/sentry/test/utils_test.dart similarity index 100% rename from test/utils_test.dart rename to packages/sentry/test/utils_test.dart diff --git a/test/version_test.dart b/packages/sentry/test/version_test.dart similarity index 100% rename from test/version_test.dart rename to packages/sentry/test/version_test.dart diff --git a/tool/dart2_test.sh b/packages/sentry/tool/dart2_test.sh similarity index 100% rename from tool/dart2_test.sh rename to packages/sentry/tool/dart2_test.sh diff --git a/tool/presubmit.sh b/packages/sentry/tool/presubmit.sh similarity index 100% rename from tool/presubmit.sh rename to packages/sentry/tool/presubmit.sh