File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
packages/angular/cli/utilities Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,18 @@ export function getWorkspace(
7878 new NodeJsSyncHost ( ) ,
7979 ) ;
8080
81- workspace . loadWorkspaceFromHost ( file ) . subscribe ( ) ;
81+ let error : unknown ;
82+ workspace . loadWorkspaceFromHost ( file ) . subscribe ( {
83+ error : e => error = e ,
84+ } ) ;
85+
86+ if ( error ) {
87+ throw new Error (
88+ `Workspace config file cannot le loaded: ${ configPath } `
89+ + `\n${ error instanceof Error ? error . message : error } `
90+ )
91+ }
92+
8293 cachedWorkspaces . set ( level , workspace ) ;
8394
8495 return workspace ;
@@ -116,7 +127,7 @@ export function getWorkspaceRaw(
116127 const ast = parseJsonAst ( content , JsonParseMode . Loose ) ;
117128
118129 if ( ast . kind != 'object' ) {
119- throw new Error ( ' Invalid JSON' ) ;
130+ throw new Error ( ` Invalid JSON file: ${ configPath } ` ) ;
120131 }
121132
122133 return [ ast , configPath ] ;
You can’t perform that action at this time.
0 commit comments