fix(compiler): show explanatory text in template errors (#20313)
Fixes: #20076 PR Close #20313
This commit is contained in:

committed by
Jason Aden

parent
9bcd7097d0
commit
3257fcdcee
@ -120,12 +120,13 @@ export class ParseError {
|
||||
|
||||
contextualMessage(): string {
|
||||
const ctx = this.span.start.getContext(100, 3);
|
||||
return ctx ? ` ("${ctx.before}[${ParseErrorLevel[this.level]} ->]${ctx.after}")` : '';
|
||||
return ctx ? `${this.msg} ("${ctx.before}[${ParseErrorLevel[this.level]} ->]${ctx.after}")` :
|
||||
this.msg;
|
||||
}
|
||||
|
||||
toString(): string {
|
||||
const details = this.span.details ? `, ${this.span.details}` : '';
|
||||
return `${this.msg}${this.contextualMessage()}: ${this.span.start}${details}`;
|
||||
return `${this.contextualMessage()}: ${this.span.start}${details}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user