>
> I am new to use TRY...CATCH...ENDTRY statement to handle error.
> In my practise, I always store loexception.message to my object.cErrorMsg
> if any exception catched and passed .T./.F. to calling program.
> Can anyone give me some ideas, when should I THROW the exception
> instead of storing error msg tro property and return boolean to calling prg?
>
Errorhandling works kind of cascading. If no one "here" can handle an error, it's handed up to the next level. Thus You can provide global errorhandling on the top level (let's say the start program) and let specific problems handle by the class that's responsible.
Let's say You have a global procedure to handle a missing or corrupt table. Then You could on the class level perform a simple check like If ! file("xy.dbf")... and if it's not there, let the class say: "This is not my business. I have no Idea who is responsible for this, and so I hand it over to *someone*". The class then throws an exception saying "Hey, could anyone *please* take care of this, I need to do some work here!"
Does this make it clear?