improved error logging and handling

This commit is contained in:
Fabian Freund
2026-01-21 11:07:23 +01:00
parent f648c43441
commit dc4a5a9c85
35 changed files with 242 additions and 115 deletions
@@ -5,6 +5,7 @@
*/
import 'dart:async';
import 'dart:developer' as developer;
import 'package:flutter_mozilla_components/src/pigeons/gecko.g.dart';
@@ -32,7 +33,13 @@ class GeckoContainerProxyService {
return await _apiInstance.healthcheck().timeout(
const Duration(milliseconds: 250),
);
} catch (_) {
} catch (e, s) {
developer.log(
'Container proxy healthcheck failed',
error: e,
stackTrace: s,
name: 'GeckoContainerProxyService',
);
return Future.value(false);
}
}
@@ -50,7 +50,7 @@ class GeckoHistoryService {
case VisitType.download:
return _api.deleteDownload(info.contentId!);
case VisitType.bookmark:
throw UnimplementedError();
throw UnimplementedError('VisitType.bookmark deletion not implemented');
}
}
@@ -5,6 +5,7 @@
*/
import 'dart:async';
import 'dart:developer' as developer;
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
@@ -66,7 +67,7 @@ class _GeckoViewState extends State<GeckoView> {
final result = await browserService.showNativeFragment();
if (result) {
debugPrint('Fragment ATTACHED after $attempt tries');
developer.log('Fragment ATTACHED after $attempt tries', name: 'GeckoView');
return true;
}
@@ -75,7 +76,7 @@ class _GeckoViewState extends State<GeckoView> {
}
}
debugPrint('Fragment FAILED after $maxRetries tries');
developer.log('Fragment FAILED after $maxRetries tries', name: 'GeckoView', level: 900);
return false;
}