Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » Exception handling in custom rules/templates
Exception handling in custom rules/templates [message #85270] Fri, 13 October 2006 18:34 Go to next message
Eclipse UserFriend
Originally posted by: matthew.gregory.us.michelin.com

I just want to make sure I handle exceptions correctly in my custom
templates and rules (TPTP 4.2.0). So I started looking through the
existing one's code and it looks like there isn't any exception handling
going on in the rules (no results from grep for 'throw' or 'catch'). In
the templates code there are three try/catch blocks, but all the catch
blocks swallow the exception. Is there a reason for this? And should I
follow the same model? Is there anywhere I can find some info how
exceptions should be handled?

Thanks in advance,

matt.
Re: Exception handling in custom rules/templates [message #85285 is a reply to message #85270] Fri, 13 October 2006 21:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: s_gutz.ca.ibm.com

Since a rule can literally do just about anything, we are protectionist
about any exceptions that get thrown. If you look at the analyze()
method in DefaultAnalysisCategory (the place where rules get executed)
you will see that we wrap the whole process in a generic try/catch
block. This ensures that no matter kind of a mess the rule gets itself
into it can't take down the analysis process.

You can certainly do any exception handling you want inside your
rule/template. In the event that an exception does happen you can use
the Log.severe() method to write a message to the log file and simply
return from your rule without generating any results.

Steve


Matt Gregory wrote:
> I just want to make sure I handle exceptions correctly in my custom
> templates and rules (TPTP 4.2.0). So I started looking through the
> existing one's code and it looks like there isn't any exception handling
> going on in the rules (no results from grep for 'throw' or 'catch'). In
> the templates code there are three try/catch blocks, but all the catch
> blocks swallow the exception. Is there a reason for this? And should I
> follow the same model? Is there anywhere I can find some info how
> exceptions should be handled?
>
> Thanks in advance,
>
> matt.
>
Re: Exception handling in custom rules/templates [message #85405 is a reply to message #85285] Tue, 17 October 2006 13:00 Go to previous message
Eclipse UserFriend
Originally posted by: matthew.gregory.us.michelin.com

Ah, I see now ... new Throwable it is! ;-)
Previous Topic:Custom Test Execution (perl) + RAC 4.2 Deployment problem ?
Next Topic:ClassNotFoundException - Verification hook class not found
Goto Forum:
  


Current Time: Thu Apr 25 23:51:36 GMT 2024

Powered by FUDForum. Page generated in 0.03801 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top