|
1 | 1 | import 'dart:async';
|
2 | 2 | import 'dart:developer';
|
3 | 3 |
|
4 |
| -import 'package:meta/meta.dart'; |
5 | 4 | import 'package:http/http.dart';
|
| 5 | +import 'package:meta/meta.dart'; |
6 | 6 |
|
7 | 7 | import '../sentry.dart';
|
8 | 8 | import 'client_reports/client_report_recorder.dart';
|
9 | 9 | import 'client_reports/noop_client_report_recorder.dart';
|
10 |
| -import 'sentry_exception_factory.dart'; |
11 |
| -import 'sentry_stack_trace_factory.dart'; |
12 | 10 | import 'diagnostic_logger.dart';
|
13 | 11 | import 'environment/environment_variables.dart';
|
14 | 12 | import 'noop_client.dart';
|
| 13 | +import 'sentry_exception_factory.dart'; |
| 14 | +import 'sentry_stack_trace_factory.dart'; |
15 | 15 | import 'transport/noop_transport.dart';
|
16 | 16 | import 'version.dart';
|
17 | 17 |
|
@@ -398,6 +398,8 @@ class SentryOptions {
|
398 | 398 | /// Enables generation of transactions and propagation of trace data. If set
|
399 | 399 | /// to null, tracing might be enabled if [tracesSampleRate] or [tracesSampler]
|
400 | 400 | /// are set.
|
| 401 | + @Deprecated( |
| 402 | + 'Use either tracesSampleRate or tracesSampler instead. This will be removed in v9') |
401 | 403 | bool? enableTracing;
|
402 | 404 |
|
403 | 405 | /// Enables sending developer metrics to Sentry.
|
@@ -452,6 +454,33 @@ class SentryOptions {
|
452 | 454 | /// Settings this to `false` will set the `level` to [SentryLevel.error].
|
453 | 455 | bool markAutomaticallyCollectedErrorsAsFatal = true;
|
454 | 456 |
|
| 457 | + /// Enables identification of exception types in obfuscated builds. |
| 458 | + /// When true, the SDK will attempt to identify common exception types |
| 459 | + /// to improve readability of obfuscated issue titles. |
| 460 | + /// |
| 461 | + /// If you already have events with obfuscated issue titles this will change grouping. |
| 462 | + /// |
| 463 | + /// Default: `true` |
| 464 | + bool enableExceptionTypeIdentification = true; |
| 465 | + |
| 466 | + final List<ExceptionTypeIdentifier> _exceptionTypeIdentifiers = []; |
| 467 | + |
| 468 | + List<ExceptionTypeIdentifier> get exceptionTypeIdentifiers => |
| 469 | + List.unmodifiable(_exceptionTypeIdentifiers); |
| 470 | + |
| 471 | + void addExceptionTypeIdentifierByIndex( |
| 472 | + int index, ExceptionTypeIdentifier exceptionTypeIdentifier) { |
| 473 | + _exceptionTypeIdentifiers.insert( |
| 474 | + index, exceptionTypeIdentifier.withCache()); |
| 475 | + } |
| 476 | + |
| 477 | + /// Adds an exception type identifier to the beginning of the list. |
| 478 | + /// This ensures it is processed first and takes precedence over existing identifiers. |
| 479 | + void prependExceptionTypeIdentifier( |
| 480 | + ExceptionTypeIdentifier exceptionTypeIdentifier) { |
| 481 | + addExceptionTypeIdentifierByIndex(0, exceptionTypeIdentifier); |
| 482 | + } |
| 483 | + |
455 | 484 | /// The Spotlight configuration.
|
456 | 485 | /// Disabled by default.
|
457 | 486 | /// ```dart
|
@@ -523,6 +552,7 @@ class SentryOptions {
|
523 | 552 | /// Returns if tracing should be enabled. If tracing is disabled, starting transactions returns
|
524 | 553 | /// [NoOpSentrySpan].
|
525 | 554 | bool isTracingEnabled() {
|
| 555 | + // ignore: deprecated_member_use_from_same_package |
526 | 556 | final enable = enableTracing;
|
527 | 557 | if (enable != null) {
|
528 | 558 | return enable;
|
|
0 commit comments