Fix false-positive error reports
This commit is contained in:
@@ -10,6 +10,7 @@ import 'package:hiddify/core/prefs/prefs.dart';
|
||||
import 'package:hiddify/data/data_providers.dart';
|
||||
import 'package:hiddify/data/repository/app_repository_impl.dart';
|
||||
import 'package:hiddify/domain/environment.dart';
|
||||
import 'package:hiddify/domain/failures.dart';
|
||||
import 'package:hiddify/features/common/active_profile/active_profile_notifier.dart';
|
||||
import 'package:hiddify/features/common/window/window_controller.dart';
|
||||
import 'package:hiddify/features/system_tray/system_tray.dart';
|
||||
@@ -66,6 +67,12 @@ Future<void> lazyBootstrap(
|
||||
options.tracesSampleRate = 0.25;
|
||||
options.enableUserInteractionTracing = true;
|
||||
options.addIntegration(sentryLogger);
|
||||
options.beforeSend = (event, {hint}) {
|
||||
return switch (event.throwable) {
|
||||
ExpectedException _ => null,
|
||||
_ => event,
|
||||
};
|
||||
};
|
||||
},
|
||||
appRunner: () => _lazyBootstrap(widgetsBinding, container, env),
|
||||
);
|
||||
|
||||
@@ -13,6 +13,7 @@ sealed class CoreServiceFailure with _$CoreServiceFailure, Failure {
|
||||
StackTrace stackTrace,
|
||||
) = UnexpectedCoreServiceFailure;
|
||||
|
||||
@With<ExpectedException>()
|
||||
const factory CoreServiceFailure.serviceNotRunning([String? message]) =
|
||||
CoreServiceNotRunning;
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ mixin Failure {
|
||||
({String type, String? message}) present(TranslationsEn t);
|
||||
}
|
||||
|
||||
/// failures ignored by analytics service etc.
|
||||
mixin ExpectedException {}
|
||||
|
||||
extension ErrorPresenter on TranslationsEn {
|
||||
String? _errorToMessage(Object error) {
|
||||
switch (error) {
|
||||
|
||||
Reference in New Issue
Block a user