Mirek Hankus created JEXL-459:
---------------------------------

             Summary: Add infomation about exceptions thrown inside empty 
function
                 Key: JEXL-459
                 URL: https://issues.apache.org/jira/browse/JEXL-459
             Project: Commons JEXL
          Issue Type: Wish
    Affects Versions: 3.6.2
            Reporter: Mirek Hankus


Currently empty function swallows all exceptions 

 
{code:java}
@Override
protected Object visit(final ASTEmptyFunction node, final Object data) {
    try {
        final Object value = node.jjtGetChild(0).jjtAccept(this, data);
        return operators.empty(node, value);
    } catch (final JexlException xany) {
        return true;
    }
} {code}
I'd like to have ability to log information about such exceptions.  For example 
expression
{code:java}
empty('aaa'.substring(400,500)) {code}
returns true, but it is very costly operation.  

Please add something like 
{code:java}
if (isSilent() && logger.isWarnEnabled()) {
    logger.warn(xany.getMessage(), xany.getCause());
} {code}
or any other way of logging problems in expressions.

 

similar problem is with size - which also ignores all exceptions
{code:java}
@Override
protected Object visit(final ASTSizeFunction node, final Object data) {
    try {
        final Object val = node.jjtGetChild(0).jjtAccept(this, data);
        return operators.size(node, val);
    } catch (final JexlException xany) {
        return 0;
    }
} {code}
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to