Skip to content

better exception stack trace #2

Description

@larryhe

Today, i use javascript-ctags to generate javascript tags for a huge project(with hundreds of JS files) and I got below errors, which didn't provide too much useful information to user which files caused this. I spent hours to figure which file caused the problem. As a suggestion, I think it's better to append the source file to the exception stack trace.

/usr/local/lib/node_modules/javascript-ctags/node_modules/esprima/esprima.js:3872
throw e;
^
Error: Line 1: Unexpected token (
at throwError (/usr/local/lib/node_modules/javascript-ctags/node_modules/esprima/esprima.js:1156:21)
at throwUnexpected (/usr/local/lib/node_modules/javascript-ctags/node_modules/esprima/esprima.js:1213:9)
at parseVariableIdentifier (/usr/local/lib/node_modules/javascript-ctags/node_modules/esprima/esprima.js:2081:13)
at /usr/local/lib/node_modules/javascript-ctags/node_modules/esprima/esprima.js:3609:38
at parseFunctionDeclaration (/usr/local/lib/node_modules/javascript-ctags/node_modules/esprima/esprima.js:2884:14)
at /usr/local/lib/node_modules/javascript-ctags/node_modules/esprima/esprima.js:3609:38
at parseSourceElement (/usr/local/lib/node_modules/javascript-ctags/node_modules/esprima/esprima.js:3055:24)
at parseSourceElements (/usr/local/lib/node_modules/javascript-ctags/node_modules/esprima/esprima.js:3095:29)
at parseProgram (/usr/local/lib/node_modules/javascript-ctags/node_modules/esprima/esprima.js:3109:19)
at /usr/local/lib/node_modules/javascript-ctags/node_modules/esprima/esprima.js:3609:38

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions