Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error reporting #368

Closed
andreiradu opened this issue Jan 28, 2019 · 0 comments · Fixed by #511
Closed

Improve error reporting #368

andreiradu opened this issue Jan 28, 2019 · 0 comments · Fixed by #511

Comments

@andreiradu
Copy link
Contributor

Right now if the transpiler throws an internal exception, there is no way to tell which file/line in the user's code generated it. For example

D:\Work\typescript_to_lua\TypescriptToLua\dist\LuaTranspiler.js:81
                    throw exception;
                    ^

TypeError: statement.initializer.declarations is not iterable
    at LuaTransformer.transformForStatement (D:\Work\typescript_to_lua\TypescriptToLua\dist\LuaTransformer.js:722:69)
    at LuaTransformer.transformStatement (D:\Work\typescript_to_lua\TypescriptToLua\dist\LuaTransformer.js:93:29)
    at statements.forEach.statement (D:\Work\typescript_to_lua\TypescriptToLua\dist\LuaTransformer.js:120:83)
    at Array.forEach (<anonymous>)
    at LuaTransformer.transformStatements (D:\Work\typescript_to_lua\TypescriptToLua\dist\LuaTransformer.js:119:20)
    at LuaTransformer.transformSourceFile (D:\Work\typescript_to_lua\TypescriptToLua\dist\LuaTransformer.js:48:33)
    at LuaTranspiler.transpileSourceFile (D:\Work\typescript_to_lua\TypescriptToLua\dist\LuaTranspiler.js:88:64)
    at LuaTranspiler.emitSourceFile (D:\Work\typescript_to_lua\TypescriptToLua\dist\LuaTranspiler.js:48:34)
    at program.getSourceFiles.forEach.sourceFile (D:\Work\typescript_to_lua\TypescriptToLua\dist\LuaTranspiler.js:36:66)
    at Array.forEach (<anonymous>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants