improve error logging

This commit is contained in:
Fabian Freund
2025-06-29 21:00:43 +02:00
parent 920c237112
commit c93d722d3f
4 changed files with 60 additions and 1 deletions
+9
View File
@@ -21,6 +21,15 @@ import 'package:weblibre/presentation/main_app.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
FlutterError.onError = (e) {
logger.e(e.toString(), error: e.exception, stackTrace: e.stack);
};
PlatformDispatcher.instance.onError = (error, stack) {
logger.e('Unhandled Error', error: error, stackTrace: stack);
return true;
};
if (kDebugMode) {
final serviceProtocolInfo = await Service.getInfo();
logger.d('VM: ${serviceProtocolInfo.serverUri}');