oracle-samples/clara-rules

Catch and re-throw exceptions on rule right-hand sides with more information

Closed this issue · 3 comments

It can be hard to track down exceptions thrown on rule right-hand sides because it's not clear where they came from, especially in cases where the right-hand side was generated and doesn't have line and file information.

We can address this by catching exceptions and wrapping them in another exception that includes the production name and right-hand side expression.

Looking forward to this simple change. FYI, in clojurescript, you can catch :default instead of js/Object. :default is the idiomatic way to catch everything.

@stephenbrady Good call! I went ahead and changed that and added a simple unit test for the ClojureScript flow.

Closing this in preparation for a 0.9.2 release.