Browse Source

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

Ofir Dagan 6 years ago
parent
commit
5e5fbf08fe
1 changed files with 10 additions and 2 deletions
  1. 10
    2
      src/Navigation.js

+ 10
- 2
src/Navigation.js View File

@@ -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) {