aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-08-14 22:35:04 +0200
committerAdrian Kummerlaender2015-08-14 22:35:04 +0200
commit566e635cd798ef558f4d57fc319f0ee857869378 (patch)
tree50781841681e7a622200520aceafd39d2d243167
parent51e69178618944d3454e76b0a7de747435be57a0 (diff)
downloadMetaTerm-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
-rw-r--r--qml/commands.js10
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);
}
}