Parcourir la source

fix(start app): show red screen in case an error is thrown while starting the app (#2556)

Ofir Dagan il y a 6 ans
Parent
révision
5e5fbf08fe
1 fichiers modifiés avec 10 ajouts et 2 suppressions
  1. 10
    2
      src/Navigation.js

+ 10
- 2
src/Navigation.js Voir le fichier

@@ -132,11 +132,19 @@ function dismissInAppNotification(params = {}) {
132 132
 }
133 133
 
134 134
 async function startTabBasedApp(params) {
135
-  return await platformSpecific.startTabBasedApp(params);
135
+  try {
136
+    return await platformSpecific.startTabBasedApp(params);
137
+  } catch(e) {
138
+    console.error(`Error while starting app: ${e}`);
139
+  }
136 140
 }
137 141
 
138 142
 async function startSingleScreenApp(params) {
139
-  return await platformSpecific.startSingleScreenApp(params);
143
+  try {
144
+    return await platformSpecific.startSingleScreenApp(params);
145
+  } catch(e) {
146
+    console.error(`Error while starting app: ${e}`);
147
+  }
140 148
 }
141 149
 
142 150
 function setEventHandler(navigatorEventID, eventHandler) {