jsparser: print "ERROR" when fail

This commit is contained in:
jean-emmanuel 2019-04-07 12:42:31 +02:00
parent 258ed95bf3
commit 27229eb3b1

View file

@ -594,6 +594,7 @@ class Widget extends EventEmitter {
return typeof r != 'string' ? JSON.stringify(r) : r
})
} catch (err) {
propValue = 'ERROR'
console.log(this.getProp('id') + '.' + propName + ': #{} error:\n' + err)
}
@ -610,6 +611,7 @@ class Widget extends EventEmitter {
})
} catch (err) {
propValue = 'ERROR'
var stackline = err.stack ? (err.stack.match(/>:([0-9]+):[0-9]+/) || '') : '',
line = stackline.length > 1 ? ' at line ' + (parseInt(stackline[1]) - 2) : ''
console.log(this.getProp('id') + '.' + propName + ': JS{{}} error:\n' + err + line)