Skip to content

Commit

Permalink
rename the throwable argument to exception (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
rxlabz authored Oct 27, 2020
1 parent dc258d9 commit c6669c3
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions dart/lib/src/hub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Hub {

/// Captures the exception
Future<SentryId> captureException(
dynamic throwable, {
dynamic exception, {
dynamic stackTrace,
dynamic hint,
}) async {
Expand All @@ -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.',
Expand All @@ -124,15 +124,15 @@ class Hub {
if (item != null) {
try {
sentryId = await item.client.captureException(
throwable,
exception,
stackTrace: stackTrace,
scope: item.scope,
hint: hint,
);
} catch (err) {
_options.logger(
SentryLevel.error,
'Error while capturing exception : ${throwable}',
'Error while capturing exception : ${exception}',
);
} finally {
_lastEventId = sentryId;
Expand Down
4 changes: 2 additions & 2 deletions dart/lib/src/hub_adapter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ class HubAdapter implements Hub {

@override
Future<SentryId> captureException(
dynamic throwable, {
dynamic exception, {
dynamic stackTrace,
dynamic hint,
}) =>
Sentry.captureException(
throwable,
exception,
stackTrace: stackTrace,
hint: hint,
);
Expand Down
2 changes: 1 addition & 1 deletion dart/lib/src/noop_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class NoOpSentryClient implements SentryClient {

@override
Future<SentryId> captureException(
dynamic throwable, {
dynamic exception, {
dynamic stackTrace,
Scope scope,
dynamic hint,
Expand Down
2 changes: 1 addition & 1 deletion dart/lib/src/noop_hub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class NoOpHub implements Hub {

@override
Future<SentryId> captureException(
dynamic throwable, {
dynamic exception, {
dynamic stackTrace,
dynamic hint,
}) =>
Expand Down
4 changes: 2 additions & 2 deletions dart/lib/src/sentry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ class Sentry {

/// Reports the [exception] and optionally its [stackTrace] to Sentry.io.
static Future<SentryId> captureException(
dynamic throwable, {
dynamic exception, {
dynamic stackTrace,
dynamic hint,
}) async =>
currentHub.captureException(
throwable,
exception,
stackTrace: stackTrace,
hint: hint,
);
Expand Down
6 changes: 3 additions & 3 deletions dart/lib/src/sentry_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<SentryId> captureException(
dynamic throwable, {
dynamic exception, {
dynamic stackTrace,
Scope scope,
dynamic hint,
}) {
final event = SentryEvent(
exception: throwable,
exception: exception,
stackTrace: stackTrace,
timestamp: _options.clock(),
);
Expand Down

0 comments on commit c6669c3

Please sign in to comment.