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(
78
78
new NodeJsSyncHost ( ) ,
79
79
) ;
80
80
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
+
82
93
cachedWorkspaces . set ( level , workspace ) ;
83
94
84
95
return workspace ;
@@ -116,7 +127,7 @@ export function getWorkspaceRaw(
116
127
const ast = parseJsonAst ( content , JsonParseMode . Loose ) ;
117
128
118
129
if ( ast . kind != 'object' ) {
119
- throw new Error ( ' Invalid JSON' ) ;
130
+ throw new Error ( ` Invalid JSON file: ${ configPath } ` ) ;
120
131
}
121
132
122
133
return [ ast , configPath ] ;
You can’t perform that action at this time.
0 commit comments