Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nickgrealy opened this issue Mar 27, 2015 · 0 comments
Open

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

nickgrealy opened this issue Mar 27, 2015 · 0 comments

Comments

@nickgrealy
Copy link
Owner

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'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant