Skip to content

Throwing an exeception in a rule function breaks the engine #6

Description

@nickgrealy

Steps to reproduce

Open http://jsfiddle.net/mjahomzu/3/
Select "cow & cat"

Actual Outcome

An exception is thrown, and the last rule is not evaluated.

Expected Outcome

No exception is thrown (treated as rule matched = false), and the last rule is evaluated.

Code snippet

var throwException = function(){ throw 'arrrgghh!'; }

var rules = [
    ['control1'    , 'p_section'],
    [throwException, 'hide'     ],
    ['foobar'      , 'show'     ]
]

RulesEngine.build(rules, showHideFn, false).evaluate({'control1':'foobar'})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions