improve error handling (#1451)

This commit is contained in:
Omar Hatem 2024-05-14 04:27:16 +03:00 committed by GitHub
parent e92e8df3aa
commit c12b4f5ff6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 37 additions and 32 deletions

View file

@ -47,6 +47,7 @@ final rootKey = GlobalKey<RootState>();
final RouteObserver<PageRoute<dynamic>> routeObserver = RouteObserver<PageRoute<dynamic>>(); final RouteObserver<PageRoute<dynamic>> routeObserver = RouteObserver<PageRoute<dynamic>>();
Future<void> main() async { Future<void> main() async {
bool isAppRunning = false;
await runZonedGuarded(() async { await runZonedGuarded(() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
@ -67,31 +68,35 @@ Future<void> main() async {
await initializeAppConfigs(); await initializeAppConfigs();
runApp(App()); runApp(App());
isAppRunning = true;
}, (error, stackTrace) async { }, (error, stackTrace) async {
runApp( if (!isAppRunning) {
MaterialApp( runApp(
debugShowCheckedModeBanner: false, MaterialApp(
home: Scaffold( debugShowCheckedModeBanner: false,
body: SingleChildScrollView( home: Scaffold(
child: Container( body: SingleChildScrollView(
margin: EdgeInsets.only(top: 50, left: 20, right: 20, bottom: 20), child: Container(
child: Column( margin: EdgeInsets.only(top: 50, left: 20, right: 20, bottom: 20),
children: [ child: Column(
Text( children: [
'Error:\n${error.toString()}', Text(
style: TextStyle(fontSize: 22), 'Error:\n${error.toString()}',
), style: TextStyle(fontSize: 22),
Text( ),
'Stack trace:\n${stackTrace.toString()}', Text(
style: TextStyle(fontSize: 16), 'Stack trace:\n${stackTrace.toString()}',
), style: TextStyle(fontSize: 16),
], ),
],
),
), ),
), ),
), ),
), ),
), );
); }
ExceptionHandler.onError(FlutterErrorDetails(exception: error, stack: stackTrace)); ExceptionHandler.onError(FlutterErrorDetails(exception: error, stack: stackTrace));
}); });

View file

@ -15,15 +15,15 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN)
APP_ANDROID_TYPE=$1 APP_ANDROID_TYPE=$1
MONERO_COM_NAME="Monero.com" MONERO_COM_NAME="Monero.com"
MONERO_COM_VERSION="1.13.1" MONERO_COM_VERSION="1.13.2"
MONERO_COM_BUILD_NUMBER=87 MONERO_COM_BUILD_NUMBER=88
MONERO_COM_BUNDLE_ID="com.monero.app" MONERO_COM_BUNDLE_ID="com.monero.app"
MONERO_COM_PACKAGE="com.monero.app" MONERO_COM_PACKAGE="com.monero.app"
MONERO_COM_SCHEME="monero.com" MONERO_COM_SCHEME="monero.com"
CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_NAME="Cake Wallet"
CAKEWALLET_VERSION="4.16.1" CAKEWALLET_VERSION="4.16.2"
CAKEWALLET_BUILD_NUMBER=211 CAKEWALLET_BUILD_NUMBER=212
CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet" CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet"
CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet" CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet"
CAKEWALLET_SCHEME="cakewallet" CAKEWALLET_SCHEME="cakewallet"

View file

@ -13,13 +13,13 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN)
APP_IOS_TYPE=$1 APP_IOS_TYPE=$1
MONERO_COM_NAME="Monero.com" MONERO_COM_NAME="Monero.com"
MONERO_COM_VERSION="1.13.1" MONERO_COM_VERSION="1.13.2"
MONERO_COM_BUILD_NUMBER=85 MONERO_COM_BUILD_NUMBER=86
MONERO_COM_BUNDLE_ID="com.cakewallet.monero" MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_NAME="Cake Wallet"
CAKEWALLET_VERSION="4.16.1" CAKEWALLET_VERSION="4.16.2"
CAKEWALLET_BUILD_NUMBER=239 CAKEWALLET_BUILD_NUMBER=240
CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
HAVEN_NAME="Haven" HAVEN_NAME="Haven"

View file

@ -16,13 +16,13 @@ if [ -n "$1" ]; then
fi fi
MONERO_COM_NAME="Monero.com" MONERO_COM_NAME="Monero.com"
MONERO_COM_VERSION="1.3.1" MONERO_COM_VERSION="1.3.2"
MONERO_COM_BUILD_NUMBER=18 MONERO_COM_BUILD_NUMBER=19
MONERO_COM_BUNDLE_ID="com.cakewallet.monero" MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
CAKEWALLET_NAME="Cake Wallet" CAKEWALLET_NAME="Cake Wallet"
CAKEWALLET_VERSION="1.9.1" CAKEWALLET_VERSION="1.9.2"
CAKEWALLET_BUILD_NUMBER=72 CAKEWALLET_BUILD_NUMBER=73
CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then