Skip to content
Permalink
Browse files
JEXL-342: fixed error handling (inner JexlException.Method throw) and…
… reporting (line info)
  • Loading branch information
henrib committed Jun 17, 2021
1 parent 21d1511 commit d7c2452200fd8e05a64cf6c56f47b146a926025c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
@@ -1683,17 +1683,19 @@ protected Object call(final JexlNode node, final Object target, Object functor,
narrow = true;
// continue;
}
// we have either evaluated and returned or no method was found
return node.isSafeLhs(isSafe())
? null
: unsolvableMethod(node, methodName, argv);
} catch (JexlException.Method xmethod) {
// ignore and handle at end; treat as an inner discover that fails
} catch (final JexlException.TryFailed xany) {
throw invocationException(node, methodName, xany);
} catch (final JexlException xthru) {
throw xthru;
} catch (final Exception xany) {
throw invocationException(node, methodName, xany);
}
// we have either evaluated and returned or no method was found
return node.isSafeLhs(isSafe())
? null
: unsolvableMethod(node, methodName, argv);
}

@Override
@@ -85,7 +85,7 @@ public JexlInfo jexlInfo() {
final int c = lc & 0xfff;
final int l = lc >> 0xc;
// at least an info with line/column number
return info != null? info.at(l, c) : new JexlInfo(null, l, c);
return info != null? info.at(info.getLine() + l - 1, c) : new JexlInfo(null, l, c);
}
// weird though; no jjSetFirstToken(...) ever called?
return info;

0 comments on commit d7c2452

Please sign in to comment.