Skip to content

Improve error reporting #368

@andreiradu

Description

@andreiradu

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>)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions