tact-lang / tact

Tact compiler main repository
https://tact-lang.org
MIT License
275 stars 56 forks source link

Fail gracefully if tact is run on a non-existing source file #425

Open anton-trunov opened 1 week ago

anton-trunov commented 1 week ago

We get the following stack tract now which is not very nice:

❯ ./bin/tact file-does-not-exist.tact
💼 Compiling project file-does-not-exist...
   > 👀 Enabling debug
Tact compilation failed
Error: ENOENT: no such file or directory, open '/Users/anton_1/ton/tact/file-does-not-exist.tact'
    at Object.openSync (node:fs:601:3)
    at Object.readFileSync (node:fs:469:35)
    at Object.readFile (/Users/anton_1/ton/tact/dist/vfs/createNodeFileSystem.js:30:33)
    at resolveImports (/Users/anton_1/ton/tact/dist/imports/resolveImports.js:15:31)
    at precompile (/Users/anton_1/ton/tact/dist/pipeline/precompile.js:13:58)
    at build (/Users/anton_1/ton/tact/dist/pipeline/build.js:58:43)
    at Object.run (/Users/anton_1/ton/tact/dist/node.js:84:47)