mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-21 05:38:42 -04:00
more locking work
This commit is contained in:
parent
41bb198d92
commit
5a8b1caf93
12 changed files with 481 additions and 484 deletions
|
@ -27,8 +27,7 @@ void main() async {
|
|||
// Ansi colors
|
||||
ansiColorDisabled = false;
|
||||
|
||||
// Catch errors
|
||||
await runZonedGuarded(() async {
|
||||
Future<void> mainFunc() async {
|
||||
// Logs
|
||||
initLoggy();
|
||||
|
||||
|
@ -53,7 +52,15 @@ void main() async {
|
|||
// Hot reloads will only restart this part, not Veilid
|
||||
runApp(LocalizedApp(localizationDelegate,
|
||||
VeilidChatApp(initialThemeData: initialThemeData)));
|
||||
}, (error, stackTrace) {
|
||||
log.error('Dart Runtime: {$error}\n{$stackTrace}');
|
||||
});
|
||||
}
|
||||
|
||||
if (kDebugMode) {
|
||||
// In debug mode, run the app without catching exceptions for debugging
|
||||
await mainFunc();
|
||||
} else {
|
||||
// Catch errors in production without killing the app
|
||||
await runZonedGuarded(mainFunc, (error, stackTrace) {
|
||||
log.error('Dart Runtime: {$error}\n{$stackTrace}');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue