Files
umbrix/lib/utils/sentry_utils.dart
Umbrix Developer 76a374950f feat: mobile-like window size and always-visible stats
- Changed window size to mobile phone format (400x800)
- Removed width condition for ActiveProxyFooter - now always visible
- Added run-umbrix.sh launch script with icon copying
- Stats cards now display on all screen sizes
2026-01-17 13:09:20 +03:00

32 lines
946 B
Dart

import 'dart:io';
import 'package:dio/dio.dart';
import 'package:umbrix/core/model/failures.dart';
import 'package:umbrix/features/proxy/model/proxy_failure.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
FutureOr<SentryEvent?> sentryBeforeSend(SentryEvent event, {Hint? hint}) {
if (canSendEvent(event.throwable)) return event;
return null;
}
bool canSendEvent(dynamic throwable) {
return switch (throwable) {
UnexpectedFailure(:final error) => canSendEvent(error),
DioException _ => false,
SocketException _ => false,
UnknownIp _ => false,
HttpException _ => false,
HandshakeException _ => false,
ExpectedFailure _ => false,
ExpectedMeasuredFailure _ => false,
_ => true,
};
}
bool canLogEvent(dynamic throwable) => switch (throwable) {
ExpectedMeasuredFailure _ => true,
_ => canSendEvent(throwable),
};