Show call stack when there is an error in js script
It is very difficult to find the cause of an error with only the error message. This commit adds the javascript call stack in KateScript::backtrace() to display the file and line number involved. - When loading the file (SyntaxError) Before: ``` Error loading script /home/jonathan/.local/share/katepart5/script/commands/xxx.js : SyntaxError: Unexpected token `numeric literal' ``` After: ``` Error loading script /home/jonathan/.local/share/katepart5/script/commands/xxx.js: SyntaxError: Unexpected token `numeric literal' Strack trace: @file:///home/jonathan/.local/share/katepart5/script/commands/xxx.js:13 ``` - When executing a command Before: ``` Error calling foo: TypeError: Cannot call method 'myfunc' of undefined ``` After: ``` Error calling foo: TypeError: Cannot call method 'myfunc' of undefined Stack trace: bar@file:///home/jonathan/.local/share/katepart5/script/commands/xxx.js:18 foo@file:///home/jonathan/.local/share/katepart5/script/commands/xxx.js:13 ```
Please register or sign in to comment