Skip to content

Commit 7f1b7b9

Browse files
GordonSmithCopilot
andauthored
Update src/witValidator.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 83b9689 commit 7f1b7b9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/witValidator.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ export class WitSyntaxValidator {
3737
return null; // Validation succeeded
3838
} catch (error: unknown) {
3939
if (error && typeof error === "object" && "stack" in error) {
40-
return extractErrorInfo(error.stack as string);
40+
const errorInfo = extractErrorInfo(error.stack as string);
41+
if (errorInfo === null) {
42+
throw new Error("Failed to parse error stack trace. Validation failed.");
43+
}
44+
return errorInfo;
4145
}
4246
}
4347
return null;

0 commit comments

Comments
 (0)