-
Notifications
You must be signed in to change notification settings - Fork 115
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
Exceptions thrown in the rules engine during propagate-items-to-nodes need better debugging information #472
Comments
based on the stacktrace, i would assume the rule that produced it was something along the lines of:
where the @k13gomez, |
@EthanEChristian yes the rule was something similar to that, except the maybe-numeric-field was inside an accumulated/merged map, either way it would be useful to have the item being propagated but I might need some help doing that. I'm writing some test cases right now to help me with that but if you have some suggestions that'd be great. |
@EthanEChristian this is what the new stack trace would look like:
|
I've updated the PR to specifically handle TestNode which seems to be the one missing throw-condition-exception functionality. |
When an exception is thrown inside the method
propagate-items-to-nodes
the stack trace provides very little details about which rule was it that threw the exception and where to handle. For this reason I think it would be much useful if an exception was thrown with cause and better debugging information such as the condition and rule (by fully qualified namespace name) where it was thrown.Example new message:
java.lang.NullPointerException: null
at clojure.lang.Numbers.ops (Numbers.java:1068)
clojure.lang.Numbers.gte (Numbers.java:263)
clojure.core$eval4653$TN_2647_TE__5713.invoke (NO_SOURCE_FILE:0)
clojure.core$filter$fn__5911.invoke (core.clj:2821)
clojure.lang.LazySeq.sval (LazySeq.java:42)
clojure.lang.LazySeq.seq (LazySeq.java:51)
clojure.lang.RT.seq (RT.java:535)
clojure.core$seq__5419.invokeStatic (core.clj:139)
clojure.core/seq (core.clj:139)
clara.rules.engine$propagate_items_to_nodes.invokeStatic (engine.cljc:164)
clara.rules.engine$propagate_items_to_nodes.invoke (engine.cljc:147)
clara.rules.engine.LocalTransport.send_tokens (engine.cljc:179)
clara.rules.engine.TestNode.left_activate (engine.cljc:940)
clara.rules.engine$fn__12690$G__12637__12697.invoke (engine.cljc:99)
clara.rules.engine$fn__12690$G__12636__12705.invoke (engine.cljc:99)
clara.rules.engine$propagate_items_to_nodes.invokeStatic (engine.cljc:165)
clara.rules.engine$propagate_items_to_nodes.invoke (engine.cljc:147)
clara.rules.engine.LocalTransport.send_tokens (engine.cljc:179)
clara.rules.engine$send_accumulated.invokeStatic (engine.cljc:990)
clara.rules.engine$send_accumulated.invoke (engine.cljc:970)
clara.rules.engine.AccumulateNode.left_activate (engine.cljc:1058)
clara.rules.engine$fn__12690$G__12637__12697.invoke (engine.cljc:99)
clara.rules.engine$fn__12690$G__12636__12705.invoke (engine.cljc:99)
clara.rules.engine$propagate_items_to_nodes.invokeStatic (engine.cljc:155)
clara.rules.engine$propagate_items_to_nodes.invoke (engine.cljc:147)
clara.rules.engine.LocalTransport.send_tokens (engine.cljc:179)
clara.rules.engine$send_accumulated.invokeStatic (engine.cljc:990)
clara.rules.engine$send_accumulated.invoke (engine.cljc:970)
clara.rules.engine.AccumulateNode.left_activate (engine.cljc:1036)
clara.rules.engine$fn__12690$G__12637__12697.invoke (engine.cljc:99)
clara.rules.engine$fn__12690$G__12636__12705.invoke (engine.cljc:99)
clara.rules.engine$propagate_items_to_nodes.invokeStatic (engine.cljc:165)
clara.rules.engine$propagate_items_to_nodes.invoke (engine.cljc:147)
clara.rules.engine.LocalTransport.send_tokens (engine.cljc:179)
clara.rules.engine$send_accumulated.invokeStatic (engine.cljc:990)
clara.rules.engine$send_accumulated.invoke (engine.cljc:970)
clara.rules.engine.AccumulateNode.left_activate (engine.cljc:1058)
clara.rules.engine$fn__12690$G__12637__12697.invoke (engine.cljc:99)
clara.rules.engine$fn__12690$G__12636__12705.invoke (engine.cljc:99)
clara.rules.engine$propagate_items_to_nodes.invokeStatic (engine.cljc:155)
clara.rules.engine$propagate_items_to_nodes.invoke (engine.cljc:147)
clara.rules.engine.LocalTransport.send_tokens (engine.cljc:179)
clara.rules.engine$send_accumulated.invokeStatic (engine.cljc:990)
clara.rules.engine$send_accumulated.invoke (engine.cljc:970)
clara.rules.engine.AccumulateWithJoinFilterNode.left_activate (engine.cljc:1404)
clara.rules.engine$fn__12690$G__12637__12697.invoke (engine.cljc:99)
clara.rules.engine$fn__12690$G__12636__12705.invoke (engine.cljc:99)
clara.rules.engine$propagate_items_to_nodes.invokeStatic (engine.cljc:155)
clara.rules.engine$propagate_items_to_nodes.invoke (engine.cljc:147)
clara.rules.engine.LocalTransport.send_tokens (engine.cljc:179)
clara.rules.engine.RootJoinNode.right_activate (engine.cljc:582)
clara.rules.engine$fn__12718$G__12712__12725.invoke (engine.cljc:107)
clara.rules.engine$fn__12718$G__12711__12733.invoke (engine.cljc:107)
clara.rules.engine$propagate_items_to_nodes.invokeStatic (engine.cljc:165)
clara.rules.engine$propagate_items_to_nodes.invoke (engine.cljc:147)
clara.rules.engine.LocalTransport.send_elements (engine.cljc:176)
clara.rules.engine.AlphaNode.alpha_activate (engine.cljc:538)
clara.rules.engine$flush_updates$flush_all__13057.invoke (engine.cljc:269)
clara.rules.engine$flush_updates.invokeStatic (engine.cljc:277)
clara.rules.engine$flush_updates.invoke (engine.cljc:252)
clara.rules.engine$fire_rules_STAR_.invokeStatic (engine.cljc:1839)
clara.rules.engine$fire_rules_STAR_.invoke (engine.cljc:1732)
clara.rules.engine.LocalSession.fire_rules (engine.cljc:1925)
clara.rules$fire_rules.invokeStatic (rules.cljc:44)
clara.rules$fire_rules.invoke (rules.cljc:29)
rules.engine$run_rules_BANG_.invokeStatic (engine.clj:72)
rules.engine$run_rules_BANG_.doInvoke (engine.clj:54)
clojure.lang.RestFn.applyTo (RestFn.java:139)
clojure.core$apply.invokeStatic (core.clj:669)
clojure.core$apply.invoke (core.clj:662)
rules.engine$run_rules_async_BANG_$fn__17913.invoke (engine.clj:139)
async_util.pool$future_supplier$reify__16298.get (pool.clj:31)
java.util.concurrent.CompletableFuture$AsyncSupply.run (:-1)
java.util.concurrent.ThreadPoolExecutor.runWorker (:-1)
java.util.concurrent.ThreadPoolExecutor$Worker.run (:-1)
java.lang.Thread.run (:-1)
The text was updated successfully, but these errors were encountered: