Skip to content

Commit 8c527ef

Browse files
committed
Add location information to error
1 parent ed05318 commit 8c527ef

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/angular-parser.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@ function throwErrors<
101101
}
102102

103103
const error = new SyntaxError(message.trim(), { cause: originalError });
104-
Object.assign({
105-
cause: originalError,
104+
Object.assign(error, {
106105
location,
107106
span: originalError.span,
108107
});
108+
error.cause ??= originalError;
109+
110+
console.log({ error });
109111

110112
throw error;
111113
}

0 commit comments

Comments
 (0)