Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 966a5a0

Browse files
authoredMar 20, 2025··
fix(dart): update throw Error code snippet (#13067)
* update throw snippet for dart and flutter * remove file
1 parent 3d94c74 commit 966a5a0

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed
 

‎docs/platforms/dart/common/index.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Verify that your app is sending events to Sentry by adding the following snippet
7878
import 'package:sentry/sentry.dart';
7979
8080
try {
81-
throw Exception('Sentry Test Error');
81+
throw StateError('Sentry Test Error');
8282
} catch (exception, stackTrace) {
8383
await Sentry.captureException(
8484
exception,

‎docs/platforms/dart/guides/flutter/index.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Verify that your app is sending events to Sentry by adding the following snippet
144144
import 'package:sentry/sentry.dart';
145145
146146
try {
147-
throw Exception('Sentry Test Exception');
147+
throw StateError('Sentry Test Exception');
148148
} catch (exception, stackTrace) {
149149
await Sentry.captureException(
150150
exception,

‎docs/platforms/dart/guides/flutter/manual-setup.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Verify that your app is sending events to Sentry by adding the following snippet
110110
import 'package:sentry/sentry.dart';
111111
112112
try {
113-
throw Exception('Sentry Test Exception');
113+
throw StateError('Sentry Test Exception');
114114
} catch (exception, stackTrace) {
115115
await Sentry.captureException(
116116
exception,

‎includes/dart-integrations/logging.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void main() async {
5757
log.info('a breadcrumb!');
5858
5959
try {
60-
throw Exception();
60+
throw StateError();
6161
} catch (error, stackTrace) {
6262
log.severe('an error!', error, stackTrace);
6363
}

‎platform-includes/capture-error/dart.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ In Dart you can capture any exception object that you caught:
44
import 'package:sentry/sentry.dart';
55
66
try {
7-
throw Exception('Sentry Test Exception');
7+
throw StateError('Sentry Test Exception');
88
} catch (exception, stackTrace) {
99
await Sentry.captureException(
1010
exception,

0 commit comments

Comments
 (0)
Please sign in to comment.