[ 
https://issues.apache.org/jira/browse/METRON-554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15644421#comment-15644421
 ] 

ASF GitHub Bot commented on METRON-554:
---------------------------------------

Github user cestella commented on a diff in the pull request:

    https://github.com/apache/incubator-metron/pull/346#discussion_r86792656
  
    --- Diff: 
metron-platform/metron-common/src/main/java/org/apache/metron/common/stellar/StellarPredicateProcessor.java
 ---
    @@ -51,6 +48,11 @@ public Boolean parse( String rule
         if(rule == null || isEmpty(rule.trim())) {
           return true;
         }
    -    return super.parse(rule, variableResolver, functionResolver, context);
    +    try {
    +      return super.parse(rule, variableResolver, functionResolver, 
context);
    +    } catch (ClassCastException e) {
    +      // predicate must return boolean
    +      throw new IllegalArgumentException(String.format("The rule '%s' does 
not return a boolean value.", rule));
    --- End diff --
    
    Can you pass in `e` as an argument to the IAE so the user can tell the type 
that was returned.  Alternatively, you could add e.getMessage() to the IAE 
message.


> Require proper error handling when invalid input is fed to Threat triage rules
> ------------------------------------------------------------------------------
>
>                 Key: METRON-554
>                 URL: https://issues.apache.org/jira/browse/METRON-554
>             Project: Metron
>          Issue Type: Improvement
>            Reporter: Michael Miklavcic
>            Assignee: Michael Miklavcic
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to