diff options
author | Adrian Kummerlaender | 2015-08-14 22:35:04 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2015-08-14 22:35:04 +0200 |
commit | 566e635cd798ef558f4d57fc319f0ee857869378 (patch) | |
tree | 50781841681e7a622200520aceafd39d2d243167 /qml | |
parent | 51e69178618944d3454e76b0a7de747435be57a0 (diff) | |
download | MetaTerm-566e635cd798ef558f4d57fc319f0ee857869378.tar MetaTerm-566e635cd798ef558f4d57fc319f0ee857869378.tar.gz MetaTerm-566e635cd798ef558f4d57fc319f0ee857869378.tar.bz2 MetaTerm-566e635cd798ef558f4d57fc319f0ee857869378.tar.lz MetaTerm-566e635cd798ef558f4d57fc319f0ee857869378.tar.xz MetaTerm-566e635cd798ef558f4d57fc319f0ee857869378.tar.zst MetaTerm-566e635cd798ef558f4d57fc319f0ee857869378.zip |
Display exceptions during `exec` processing as errors
Diffstat (limited to 'qml')
-rw-r--r-- | qml/commands.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/qml/commands.js b/qml/commands.js index 23f0a7f..f76af01 100644 --- a/qml/commands.js +++ b/qml/commands.js @@ -19,10 +19,14 @@ function execute(output, command) { } function exec(output, args) { - var result = eval(args.join(' ')); + try { + var result = eval(args.join(' ')); - if ( typeof result !== 'undefined' ) { - output.log(result); + if ( typeof result !== 'undefined' ) { + output.log(result); + } + } catch (exception) { + output.error(exception); } } |