summaryrefslogtreecommitdiff
path: root/packages/astro-parser/src/utils/error.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/astro-parser/src/utils/error.ts')
-rw-r--r--packages/astro-parser/src/utils/error.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/astro-parser/src/utils/error.ts b/packages/astro-parser/src/utils/error.ts
index 00eed866f..a532f07dd 100644
--- a/packages/astro-parser/src/utils/error.ts
+++ b/packages/astro-parser/src/utils/error.ts
@@ -27,6 +27,7 @@ export class CompileError extends Error {
/** Throw CompileError */
export default function error(
+ code: string,
message: string,
props: {
name: string;
@@ -36,7 +37,7 @@ export default function error(
end?: number;
}
): never {
- const err = new CompileError({ message, start: props.start, end: props.end, filename: props.filename });
+ const err = new CompileError({ code, message, start: props.start, end: props.end, filename: props.filename });
err.name = props.name;
throw err;