Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Kbizobj data error handlers not invoking
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00257436
Message ID:
00258360
Views:
18
> I just checked it on my system (also v4.2) and there is definitely code in the Error event. Are you sure you're opening the parent class (ie. not a subclass of it)? Here's part of the description:
>
>*----------------------- Usage Section --------------------------
>*) Description:
>*) Passes the error up the containership hierarchy. If the
>*) parent does not exist, call VFP's default error handler


Actually, that code is stored in in the parent class (ContainerX) for KBizObj like Gar pointed out in the first message. ContainerX as the parent is new in 4.2, so I apologize to Gar, I had to look at this a little closer myself to get what was the source of confusion here.

So here's the deal (I think, Kevin/BOb/Someone correct me if I'm wrong please). The code above is to tie the bizobj into the framework's global error handling mechanism where it gets passed up the call stack and logged if all else fails. So it makes sense for this to be in ContainerX - it's base functionality that should be used by not just BizObj's but other container type objects too. But if you look at page 229 in Developer's Guide, 1st page of the Error Handling section, you'll see a simple DO CASE example of the custom error handling you need to add to your BizObj so that it can handle it own errors that are specific to it's responsibilities. This shows an OTHERWISE DODEFAULT(nError, CMethod, nLine) that should be used to invoke the ContainerX.Error() code to pass the error the BizObj can't resolve itself up the call stack to Global Error Handler.

I checked my 4.1 compiled app at home and that type of DO CASE handling is how I handled it in my older KBiZObj's, I havent gotten to doing validation stuff in the new 4.2 class libs yet but sure seems to me it should work the same.

HTH Gar
Roxanne M. Seibert
Independent Consultant, VFP MCP

Code Monkey Like Fritos
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform