Skip to content

Commit

Permalink
feat(irBuilder): Extra error context
Browse files Browse the repository at this point in the history
  • Loading branch information
byakuren-hijiri committed Jul 26, 2024
1 parent 6f56ae8 commit 5f99485
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/internals/tactIRBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -769,14 +769,24 @@ class TactConfigManager {
return this.config.projects.reduce(
(acc: Map<ProjectName, TactAST>, projectConfig) => {
this.ctx.logger.debug(`Parsing project ${projectConfig.name} ...`);
const ctx = precompile(
new CompilerContext({ shared: {} }),
project,
stdlib,
projectConfig.path,
);
acc.set(projectConfig.name, getRawAST(ctx));
return acc;
try {
const ctx = precompile(
new CompilerContext({ shared: {} }),
project,
stdlib,
projectConfig.path,
);
acc.set(projectConfig.name, getRawAST(ctx));
return acc;
} catch (error: unknown) {
if (error instanceof Error) {
throw new Error(
`Tact Compiler Error: ${error.message}\nPlease report it to https://github.com/nowarp/misti/issues/new`,
);
} else {
throw error;
}
}
},
new Map<ProjectName, TactAST>(),
);
Expand Down

0 comments on commit 5f99485

Please sign in to comment.