From c6669c32023fc9358bff7bc213278560d3f204e3 Mon Sep 17 00:00:00 2001 From: Erick Ghaumez Date: Tue, 27 Oct 2020 20:59:07 +0100 Subject: [PATCH] rename the `throwable` argument to `exception` (#142) --- CHANGELOG.md | 1 + dart/lib/src/hub.dart | 8 ++++---- dart/lib/src/hub_adapter.dart | 4 ++-- dart/lib/src/noop_client.dart | 2 +- dart/lib/src/noop_hub.dart | 2 +- dart/lib/src/sentry.dart | 4 ++-- dart/lib/src/sentry_client.dart | 6 +++--- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ba8c18586..e4a0ec80ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ - Fix: Breadcrumb data should accept serializable types and not only String values - Ref: added Scope.applyToEvent - Ref: rename sdk files accordely to their content +- Ref: rename the `throwable` argument name to `exception` in `captureEvents(...)` # `package:sentry` changelog diff --git a/dart/lib/src/hub.dart b/dart/lib/src/hub.dart index bb9402b138..d24d8b56c9 100644 --- a/dart/lib/src/hub.dart +++ b/dart/lib/src/hub.dart @@ -103,7 +103,7 @@ class Hub { /// Captures the exception Future captureException( - dynamic throwable, { + dynamic exception, { dynamic stackTrace, dynamic hint, }) async { @@ -114,7 +114,7 @@ class Hub { SentryLevel.warning, "Instance is disabled and this 'captureException' call is a no-op.", ); - } else if (throwable == null) { + } else if (exception == null) { _options.logger( SentryLevel.warning, 'captureException called with null parameter.', @@ -124,7 +124,7 @@ class Hub { if (item != null) { try { sentryId = await item.client.captureException( - throwable, + exception, stackTrace: stackTrace, scope: item.scope, hint: hint, @@ -132,7 +132,7 @@ class Hub { } catch (err) { _options.logger( SentryLevel.error, - 'Error while capturing exception : ${throwable}', + 'Error while capturing exception : ${exception}', ); } finally { _lastEventId = sentryId; diff --git a/dart/lib/src/hub_adapter.dart b/dart/lib/src/hub_adapter.dart index 074a2c62e1..be527b7cf3 100644 --- a/dart/lib/src/hub_adapter.dart +++ b/dart/lib/src/hub_adapter.dart @@ -32,12 +32,12 @@ class HubAdapter implements Hub { @override Future captureException( - dynamic throwable, { + dynamic exception, { dynamic stackTrace, dynamic hint, }) => Sentry.captureException( - throwable, + exception, stackTrace: stackTrace, hint: hint, ); diff --git a/dart/lib/src/noop_client.dart b/dart/lib/src/noop_client.dart index 758ac86d37..1b5be04a8c 100644 --- a/dart/lib/src/noop_client.dart +++ b/dart/lib/src/noop_client.dart @@ -23,7 +23,7 @@ class NoOpSentryClient implements SentryClient { @override Future captureException( - dynamic throwable, { + dynamic exception, { dynamic stackTrace, Scope scope, dynamic hint, diff --git a/dart/lib/src/noop_hub.dart b/dart/lib/src/noop_hub.dart index 61e59c24ca..db7e1637d5 100644 --- a/dart/lib/src/noop_hub.dart +++ b/dart/lib/src/noop_hub.dart @@ -26,7 +26,7 @@ class NoOpHub implements Hub { @override Future captureException( - dynamic throwable, { + dynamic exception, { dynamic stackTrace, dynamic hint, }) => diff --git a/dart/lib/src/sentry.dart b/dart/lib/src/sentry.dart index 8251e212bd..0ee4365472 100644 --- a/dart/lib/src/sentry.dart +++ b/dart/lib/src/sentry.dart @@ -56,12 +56,12 @@ class Sentry { /// Reports the [exception] and optionally its [stackTrace] to Sentry.io. static Future captureException( - dynamic throwable, { + dynamic exception, { dynamic stackTrace, dynamic hint, }) async => currentHub.captureException( - throwable, + exception, stackTrace: stackTrace, hint: hint, ); diff --git a/dart/lib/src/sentry_client.dart b/dart/lib/src/sentry_client.dart index 569b51050b..2d19ed7f2e 100644 --- a/dart/lib/src/sentry_client.dart +++ b/dart/lib/src/sentry_client.dart @@ -84,15 +84,15 @@ abstract class SentryClient { platform: event.platform ?? sdkPlatform, ); - /// Reports the [throwable] and optionally its [stackTrace] to Sentry.io. + /// Reports the [exception] and optionally its [stackTrace] to Sentry.io. Future captureException( - dynamic throwable, { + dynamic exception, { dynamic stackTrace, Scope scope, dynamic hint, }) { final event = SentryEvent( - exception: throwable, + exception: exception, stackTrace: stackTrace, timestamp: _options.clock(), );