[libvirt] [libvirt-java] [PATCH 15/65] Start refactoring of error handling

Claudio Bley cbley at av-test.de
Wed Mar 26 13:33:59 UTC 2014


At Fri, 21 Feb 2014 10:43:15 +0000,
Daniel P. Berrange wrote:
> 
> On Thu, Feb 13, 2014 at 04:22:23PM +0100, Claudio Bley wrote:
> > Almost every class contains a processError() method with an identical
> > definition, just forwarding the call to ErrorHandler.processError(Libvirt).
> > 
> > This function is always called after a libvirt function call (as per its
> > javadoc comment).
> > 
> > But, actually, there's no use in always calling processError when there was
> > no error signalled by the libvirt function having been called. This is just
> > a waste of CPU cycles.
> > 
> > Furthermore, it's more than ugly that the error handling is littered all
> > over the place in every class.
> > 
> > This patch lays ground for generalizing the error handling in a common
> > place and removing those functions from the individual classes.
> > 
> > Basically, this copies the processError(int) and processError<T>(T)
> > methods from the Connect class to the ErrorHandler class as static
> > methods.
> > 
> > It deprecates the processError(Libvirt) method, which will be removed
> > eventually in a later patch.
> > 
> > Signed-off-by: Claudio Bley <cbley at av-test.de>
> > ---
> >  src/main/java/org/libvirt/ErrorHandler.java |   47 ++++++++++++++++++++++++++-
> >  1 file changed, 46 insertions(+), 1 deletion(-)
> 
> ACK

Thanks, pushed.




More information about the libvir-list mailing list