From 566e635cd798ef558f4d57fc319f0ee857869378 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Fri, 14 Aug 2015 22:35:04 +0200 Subject: Display exceptions during `exec` processing as errors --- qml/commands.js | 10 +++++++--- 1 file 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); } } -- cgit v1.2.3