|
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 |
|
@@ -452,6 +452,33 @@ class SentryOptions { |
452 | 452 | /// Settings this to `false` will set the `level` to [SentryLevel.error]. |
453 | 453 | bool markAutomaticallyCollectedErrorsAsFatal = true; |
454 | 454 |
|
| 455 | + /// Enables identification of exception types in obfuscated builds. |
| 456 | + /// When true, the SDK will attempt to identify common exception types |
| 457 | + /// to improve readability of obfuscated issue titles. |
| 458 | + /// |
| 459 | + /// If you already have events with obfuscated issue titles this will change grouping. |
| 460 | + /// |
| 461 | + /// Default: `true` |
| 462 | + bool enableExceptionTypeIdentification = true; |
| 463 | + |
| 464 | + final List<ExceptionTypeIdentifier> _exceptionTypeIdentifiers = []; |
| 465 | + |
| 466 | + List<ExceptionTypeIdentifier> get exceptionTypeIdentifiers => |
| 467 | + List.unmodifiable(_exceptionTypeIdentifiers); |
| 468 | + |
| 469 | + void addExceptionTypeIdentifierByIndex( |
| 470 | + int index, ExceptionTypeIdentifier exceptionTypeIdentifier) { |
| 471 | + _exceptionTypeIdentifiers.insert( |
| 472 | + index, exceptionTypeIdentifier.withCache()); |
| 473 | + } |
| 474 | + |
| 475 | + /// Adds an exception type identifier to the beginning of the list. |
| 476 | + /// This ensures it is processed first and takes precedence over existing identifiers. |
| 477 | + void prependExceptionTypeIdentifier( |
| 478 | + ExceptionTypeIdentifier exceptionTypeIdentifier) { |
| 479 | + addExceptionTypeIdentifierByIndex(0, exceptionTypeIdentifier); |
| 480 | + } |
| 481 | + |
455 | 482 | /// The Spotlight configuration. |
456 | 483 | /// Disabled by default. |
457 | 484 | /// ```dart |
|
0 commit comments