diff --git a/src/util/error.ts b/src/util/error.ts index b1940dd71..d98cd9b8e 100644 --- a/src/util/error.ts +++ b/src/util/error.ts @@ -4,17 +4,19 @@ import { Template } from '../template/template' export abstract class LiquidError extends Error { private token: Token + private context: string private originalError: Error public constructor (err: Error, token: Token) { super(err.message) this.originalError = err this.token = token + this.context = '' } protected update () { const err = this.originalError - const context = mkContext(this.token) + this.context = mkContext(this.token) this.message = mkMessage(err.message, this.token) - this.stack = this.message + '\n' + context + + this.stack = this.message + '\n' + this.context + '\n' + this.stack + '\nFrom ' + err.stack } }