Throw TactCompilationError
instead Error
when possible
#645
Labels
api
Tact's TypeScript API for third-party tools
errors
Error reporting mechanism
good first issue
Good for newcomers
Milestone
Tact compiler throws exceptions when compilation errors occur. Typically, it uses
throwCompilationError
for this.This enables the third-party tools to understand the reason of the exception by inspecting the error stacktrace, e.g.:
The problem is that in some cases we use
throw new Error
when compilation error occurs. For example, when an unresolved import appears:tact/src/imports/resolveImports.ts
Line 50 in 2524aae
The idea is to examine all the cases when we
throw
and to replace them withthrowCompilationError
orthrowInternalCompilerError
if possible.This will be helpful for the tooling and will provide a more unified internal API, fostering debugging of Tact.
The text was updated successfully, but these errors were encountered: