cancel
Showing results for 
Search instead for 
Did you mean: 

Exception handling good practice in Jscript

Community Leader

Re: Exception handling good practice in Jscript

Thanks @AlexKaras 

 

I haven't forgotten you, I'm just mulling things over at the moment.  You make some very good points in your post and your input is very welcome.


-------------------------------------------------
Standard syntax disclaimers apply
Regards,
Community Leader

Re: Exception handling good practice in Jscript

Hi @AlexKaras 

 

I've opted in the end to go more down the route of building the KWTs themselves with Try.. catches.. in them and having the KWTs return a true/false in the catch/finally depending on how things went.  Much less OO, much more scripting approach:

 

Return false from a Keyword Test

 

I'm using some work in the OnLogError to help me handle and error things better and report back better info, but the approach is now leaving only application exceptions to technically thow errors.  Other errors will be handled with intensive standard wait/find logic, but scripts should always return Something.  Either a true/false or an object/null which can be tested and acted upon by the calling function/KWTs.  The next KWT in a tree will check the lastresult for a true/false and log/stop as required


-------------------------------------------------
Standard syntax disclaimers apply
Regards,
New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors