diff --git a/src/errors.ts b/src/errors.ts index 4984e68e7..0dd9ce313 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -84,11 +84,11 @@ export function throwCompilationError( message: string, source?: SrcInfo, ): never { - const loc = + const msg = source === undefined - ? "" + ? message : `${locationStr(source)}${message}\n${source.interval.getLineAndColumnMessage()}`; - throw new TactCompilationError(loc, source); + throw new TactCompilationError(msg, source); } export function throwInternalCompilerError(