refactor(): add better err msg for missing main entry (#7063)

This commit is contained in:
Martin Yankov
2019-03-25 14:07:23 +02:00
committed by GitHub
parent 32646be19c
commit 26679d42ff
2 changed files with 7 additions and 4 deletions

View File

@ -273,16 +273,15 @@ function createRootView(v?: View) {
let rootView = v;
if (!rootView) {
// try to navigate to the mainEntry (if specified)
if (mainEntry) {
if (!mainEntry) {
throw new Error("Main entry is missing. App cannot be started. Verify app bootstrap.");
} else {
if (createRootFrame.value) {
const frame = rootView = new Frame();
frame.navigate(mainEntry);
} else {
rootView = createViewFromEntry(mainEntry);
}
} else {
// TODO: Throw an exception?
throw new Error("A Frame must be used to navigate to a Page.");
}
}

View File

@ -1171,6 +1171,10 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
if (!rootView) {
const mainEntry = application.getMainEntry();
if (!mainEntry) {
throw new Error("Main entry is missing. App cannot be started. Verify app bootstrap.");
}
const intent = activity.getIntent();
if (fireLaunchEvent) {