Skip to content

Commit

Permalink
declare a default unknown as a path when creating errors
Browse files Browse the repository at this point in the history
  • Loading branch information
noelforte committed Dec 1, 2024
1 parent a90be06 commit 6c8658f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class Environment {
code = transformTemplateCode(code, dataVarname);
} catch (error) {
if (error instanceof TransformError) {
throw this.createError(path || "", source, error.pos, error);
throw this.createError(path, source, error.pos, error);
}

throw error;
Expand Down Expand Up @@ -179,7 +179,7 @@ export class Environment {
const { position, error } = result;

if (error) {
throw this.createError(path || "unknown", source, position, error);
throw this.createError(path, source, position, error);
}

for (const tokenPreprocessor of this.tokenPreprocessors) {
Expand Down Expand Up @@ -312,7 +312,7 @@ export class Environment {
}

createError(
path: string,
path: string = "unknown",
source: string,
position: number,
cause: Error,
Expand Down

0 comments on commit 6c8658f

Please sign in to comment.