FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

refactor: throw if global css file is not found in webpack context · NativeScript/NativeScript@077fe03 · GitHub

Commit 077fe03

Browse files
committed
refactor: throw if global css file is not found in webpack context
1 parent 1f77301 commit 077fe03

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎tns-core-modules/application/application-common.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ export function getCssFileName(): string {
7373
}
7474

7575
export function loadAppCss(): void {
76-
events.notify(<LoadAppCSSEventData>{ eventName: "loadAppCss", object: app, cssFile: getCssFileName() });
76+
try {
77+
events.notify(<LoadAppCSSEventData>{ eventName: "loadAppCss", object: app, cssFile: getCssFileName() });
78+
} catch (e) {
79+
throw new Error(`The file ${getCssFileName()} couldn't be loaded! ` +
80+
`You may need to register it inside ./app/vendor.ts.`);
81+
}
7782
}
7883

7984
export function addCss(cssText: string): void {
@@ -82,4 +87,4 @@ export function addCss(cssText: string): void {
8287

8388
global.__onUncaughtError = function (error: NativeScriptError) {
8489
events.notify(<UnhandledErrorEventData>{ eventName: uncaughtErrorEvent, object: app, android: error, ios: error, error: error });
85-
}
90+
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL