From aa9ce739c0041715a42ab878c7092fa6e76a8208 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 5 Jan 2017 18:11:15 +0100 Subject: [PATCH] add catch on buildTree --- src/util/internalCallTree.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/util/internalCallTree.js b/src/util/internalCallTree.js index cb6dbc92dc..e25e3737b4 100644 --- a/src/util/internalCallTree.js +++ b/src/util/internalCallTree.js @@ -97,12 +97,16 @@ async function buildTree (tree, step, scopeId) { return { outStep: step, error: 'InternalCallTree - No source Location. ' + step } } if (sourceLocation.jump === 'i') { - var result = await buildTree(tree, step + 1, scopeId === '' ? subScope.toString() : scopeId + '.' + subScope) - if (result.error) { - return result - } else { - step = result.outStep - subScope++ + try { + var result = await buildTree(tree, step + 1, scopeId === '' ? subScope.toString() : scopeId + '.' + subScope) + if (result.error) { + return { outStep: step, error: 'InternalCallTree - ' + result.error } + } else { + step = result.outStep + subScope++ + } + } catch (e) { + return { outStep: step, error: 'InternalCallTree - ' + e.message } } } else if (sourceLocation.jump === 'o') { tree.scopes[scopeId].lastStep = step