improved error logging and handling
This commit is contained in:
+8
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user