Skip to content

Commit 88f2bd1

Browse files
DBosleychuckjaz
authored andcommitted
Fixes #128 for all errors (#138)
Adding try/catch around @angular/language-service calls to avoid output window opening on its own.
1 parent acae7ea commit 88f2bd1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

server/src/editorServices.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3035,7 +3035,15 @@ export class LineLeaf implements LineCollection {
30353035
function logServiceTimes(logger: Logger, service: ng.LanguageService): ng.LanguageService {
30363036
function time<T>(name: string, cb: () => T): T {
30373037
const start = Date.now();
3038-
const result = cb();
3038+
let result: T = null;
3039+
try{
3040+
result = cb();
3041+
} catch (error) {
3042+
logger.msg(
3043+
`Error for ${name}:\n` +
3044+
` ${error.stack || error}`
3045+
);
3046+
}
30393047
logger.msg(`${name}: ${Date.now() - start}ms`);
30403048
return result;
30413049
}

0 commit comments

Comments
 (0)