04-27-2015 04:09 AM
I did an override of Handle Error expecting I could let an error in my override of Actor Core propagate through to the parent. The parent Actor Core code suggests that an Error In will pass through to Handle Error (skipping any message processing), however my override is not being called and my Actor appears to be stopping.
Is my understanding of the purpose of Handle Error in "error"?
04-27-2015 04:18 AM
Handle Error is called from the parent's actor core. Any code in your actor core is parallel to the parent's actor core, as you probably forked the wire before the "call parent node" VI. Handle error handles errors in the parent thread, i.e. message handling; your actor core needs its own error handling.
Or in other words: Yes, Handle Error is used only for message processing errors.
Thanks,
Danielle
04-27-2015 11:23 AM
An alternative way of stating it... if you have errors in your parallel code and you want them to be processed by Handle Errors, you need to send a message to yourself that says "please process this error" -- and let the Do method just pass that error out.
The "Send Error Report.vi" in the palettes does exactly this.
04-27-2015 02:03 PM
AristosQueue wrote:
An alternative way of stating it... if you have errors in your parallel code and you want them to be processed by Handle Errors, you need to send a message to yourself that says "please process this error" -- and let the Do method just pass that error out.
The "Send Error Report.vi" in the palettes does exactly this.
Thank you, sir. I also found the thread at https://decibel.ni.com/content/message/89022#89022. I especially like your post #9 in that thread and will be looking at taking that philosophy into my own app. Time to scrap the old LabVIEW error handling paradigm and swap in the new.
I'd also like to thank you and your partner(s) in crime for coming up with this great design pattern. It's very satisfying when you get your application working and you know it's a lot more robust and scaleable than it would have been otherwise.
04-27-2015 04:34 PM
You're welcome.
06-23-2016 07:07 PM
Although an old thread, I decided to post here since it's on the same subject.
I am struggling to understand how an Actor "quits" in the error case. I setup my project thusly:
What happens is my root actor exits normally if I DONT send an Error Report.
When I send an Error Report, my root actor does NOT exit (libraries are all locked). Trying this same scenario with nested actors and none of them get Stop messages. With no error going into parent Actor Core, any nested actors all stop normally.
Is the description of Stop Core correct that: "By default this method does nothing....." because the code itself shows sending a stop message to the array of nested actor enqueuers.
06-24-2016 01:45 AM
Just a 'shot in the blue': Is your error handler configured to cancel the error?
06-24-2016 02:12 PM
I don't have to cancel the error. The default error handling makes it "go away". Sure, it is returned to my override of Actor Core in my root actor after the call to the parent Actor Core, but at that point the application is terminating anyway. For my project, application errors are always fatal and always result in the application doing an exit (after informing the user what happened).
06-24-2016 04:20 PM
The shutting down of the nested actors is new in LV 2014... and I guess I forgot to update the Context Help. I'll CAR that to fix for LV 2017 (2016 is already done).
(CAR 593676 filed)
06-24-2016 04:36 PM
If you pass an error directly into Actor:Actor Core.vi, you will not trip Handle Error at all, but it will still trip Stop.vi, which will unconditionally call Stop Core. There's no way around that behavior.
> When I send an Error Report, my root actor does NOT exit (libraries are all locked).
I cannot explain that behavior. It works fine in all of my tests -- I send an error with Send Error Report.vi and all the actors stop.
If you use Send Error Report.vi... make sure that you're actually sending an error? I mean, if the value you wire in is "no error", then it would have the behavior you describe. I know that's almost insulting like asking "have you tried plugging it in?" but I'm at a loss to explain the behavior otherwise.